Normalize scope before storing in database

This commit is contained in:
harryzcy 2022-09-07 11:00:45 -04:00
parent 1ebfc83bb2
commit b751682bc0
No known key found for this signature in database
GPG key ID: CC2953E050C19686

View file

@ -444,7 +444,8 @@ func (f *NewAccessTokenForm) GetScope() auth_model.AccessTokenScope {
} }
} }
scope = strings.TrimSuffix(scope, ",") scope = strings.TrimSuffix(scope, ",")
return auth_model.AccessTokenScope(scope) s, _ := auth_model.AccessTokenScope(scope).Normalize() // error should not happen, since fields are valid scopes
return s
} }
// EditOAuth2ApplicationForm form for editing oauth2 applications // EditOAuth2ApplicationForm form for editing oauth2 applications