mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
revert codacy
This commit is contained in:
@@ -34,10 +34,8 @@ type AuthMiddleware struct {
|
||||
audience string
|
||||
}
|
||||
|
||||
type key string
|
||||
|
||||
const (
|
||||
userProperty key = "user"
|
||||
userProperty = "user"
|
||||
)
|
||||
|
||||
// NewAuthMiddleware instance constructor
|
||||
@@ -131,10 +129,10 @@ func (m *AuthMiddleware) CheckPATFromRequest(w http.ResponseWriter, r *http.Requ
|
||||
}
|
||||
|
||||
claimMaps := jwt.MapClaims{}
|
||||
claimMaps[string(jwtclaims.UserIDClaim)] = user.Id
|
||||
claimMaps[m.audience+string(jwtclaims.AccountIDSuffix)] = account.Id
|
||||
claimMaps[m.audience+string(jwtclaims.DomainIDSuffix)] = account.Domain
|
||||
claimMaps[m.audience+string(jwtclaims.DomainCategorySuffix)] = account.DomainCategory
|
||||
claimMaps[jwtclaims.UserIDClaim] = user.Id
|
||||
claimMaps[m.audience+jwtclaims.AccountIDSuffix] = account.Id
|
||||
claimMaps[m.audience+jwtclaims.DomainIDSuffix] = account.Domain
|
||||
claimMaps[m.audience+jwtclaims.DomainCategorySuffix] = account.DomainCategory
|
||||
jwtToken := jwt.NewWithClaims(jwt.SigningMethodHS256, claimMaps)
|
||||
newRequest := r.WithContext(context.WithValue(r.Context(), jwtclaims.TokenUserProperty, jwtToken))
|
||||
// Update the current request with the new context information.
|
||||
|
||||
Reference in New Issue
Block a user