Rollback sooner

This commit is contained in:
Melon 2024-02-26 18:44:44 +00:00
parent b1fc0d59fe
commit 6717f11f02
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -37,11 +37,11 @@ func generateIDToken(ti oauth2.TokenInfo, us *database.DB, key mjwt.Signer) (tok
if err != nil { if err != nil {
return "", err return "", err
} }
defer tx.Rollback()
user, err := tx.GetUser(ti.GetUserID()) user, err := tx.GetUser(ti.GetUserID())
if err != nil { if err != nil {
return "", err return "", err
} }
tx.Rollback()
token, err = key.GenerateJwt(user.Sub, "", jwt.ClaimStrings{ti.GetClientID()}, ti.GetAccessExpiresIn(), &IdTokenClaims{Subject: user.Sub}) token, err = key.GenerateJwt(user.Sub, "", jwt.ClaimStrings{ti.GetClientID()}, ti.GetAccessExpiresIn(), &IdTokenClaims{Subject: user.Sub})
return return