From 6717f11f02e8d6a8e6fe731f420578aa6e831b47 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Mon, 26 Feb 2024 18:44:44 +0000 Subject: [PATCH] Rollback sooner --- server/id_token.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/id_token.go b/server/id_token.go index 600f61a..63061e2 100644 --- a/server/id_token.go +++ b/server/id_token.go @@ -37,11 +37,11 @@ func generateIDToken(ti oauth2.TokenInfo, us *database.DB, key mjwt.Signer) (tok if err != nil { return "", err } + defer tx.Rollback() user, err := tx.GetUser(ti.GetUserID()) if err != nil { return "", err } - tx.Rollback() token, err = key.GenerateJwt(user.Sub, "", jwt.ClaimStrings{ti.GetClientID()}, ti.GetAccessExpiresIn(), &IdTokenClaims{Subject: user.Sub}) return