feat: fix null user crash in RefreshToken()

This commit is contained in:
Yang Luo 2024-10-15 21:38:33 +08:00
parent 7cd8f030ee
commit fb561a98c8

View File

@ -332,6 +332,9 @@ func RefreshToken(grantType string, refreshToken string, scope string, clientId
if err != nil {
return nil, err
}
if user == nil {
return "", fmt.Errorf("The user: %s doesn't exist", util.GetId(application.Organization, token.User))
}
if user.IsForbidden {
return &TokenError{