Merge branch 'authorizerdev/authorizer:main' into main
This commit is contained in:
@@ -165,7 +165,12 @@ func GetAccessToken(gc *gin.Context) (string, error) {
|
||||
return "", fmt.Errorf(`unauthorized`)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(auth, "Bearer ") {
|
||||
authSplit := strings.Split(auth, " ")
|
||||
if len(authSplit) != 2 {
|
||||
return "", fmt.Errorf(`unauthorized`)
|
||||
}
|
||||
|
||||
if strings.ToLower(authSplit[0]) != "bearer" {
|
||||
return "", fmt.Errorf(`not a bearer token`)
|
||||
}
|
||||
|
||||
@@ -358,7 +363,12 @@ func GetIDToken(gc *gin.Context) (string, error) {
|
||||
return "", fmt.Errorf(`unauthorized`)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(auth, "Bearer ") {
|
||||
authSplit := strings.Split(auth, " ")
|
||||
if len(authSplit) != 2 {
|
||||
return "", fmt.Errorf(`unauthorized`)
|
||||
}
|
||||
|
||||
if strings.ToLower(authSplit[0]) != "bearer" {
|
||||
return "", fmt.Errorf(`not a bearer token`)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user