Revert "refactor: if the token doesn't match our purpose only error if EmptyAllowed is off"
This reverts commit b1fcc7f7ae
.
This commit is contained in:
parent
b1fcc7f7ae
commit
bee80a9981
|
@ -129,9 +129,7 @@ func AuthMiddleware(options AuthMiddlewareOptions) func(http.Handler) http.Handl
|
||||||
aud, _ := claim.GetAudience()
|
aud, _ := claim.GetAudience()
|
||||||
|
|
||||||
if options.Purpose != account.JWTPurposeNone && slices.Contains[jwt.ClaimStrings, string](aud, string(options.Purpose)) == false {
|
if options.Purpose != account.JWTPurposeNone && slices.Contains[jwt.ClaimStrings, string](aud, string(options.Purpose)) == false {
|
||||||
if !options.EmptyAllowed {
|
return account.ErrJWTInvalid
|
||||||
return account.ErrJWTInvalid
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue