mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-11 09:46:37 +08:00
fix lint
This commit is contained in:
@@ -16,8 +16,8 @@ import (
|
||||
|
||||
const ctxRelayNodeKey = "relay_node"
|
||||
|
||||
// RelayAuth authenticates relay requests using X-Agent-Token and verifies tunnel_relay type.
|
||||
func RelayAuth() gin.HandlerFunc {
|
||||
// Auth authenticates relay requests using X-Agent-Token and verifies tunnel_relay type.
|
||||
func Auth() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
token := strings.TrimSpace(c.GetHeader("X-Agent-Token"))
|
||||
node, err := authenticateAccessToken(c.Request.Context(), token)
|
||||
@@ -46,4 +46,4 @@ func authenticateAccessToken(ctx context.Context, token string) (*model.OpenFlar
|
||||
return nil, err
|
||||
}
|
||||
return node, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user