🐛 Fix didn't handle invalid auth sessions

This commit is contained in:
2024-03-17 23:13:44 +08:00
parent ea460c3623
commit 437c2e5b4b
2 changed files with 3 additions and 1 deletions

View File

@ -56,6 +56,8 @@ func Authenticate(atk, rtk string) (models.Account, string, string, error) {
})
if err != nil {
return user, reply.GetAccessToken(), reply.GetRefreshToken(), err
} else if !reply.IsValid {
return user, reply.GetAccessToken(), reply.GetRefreshToken(), fmt.Errorf("invalid authorization context")
}
user, err = LinkAccount(reply.Userinfo)