1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-05 23:07:58 +00:00

fix: move audit log call before TX is committed (#854)

This commit is contained in:
Alessandro (Ale) Segala
2025-08-20 15:01:53 -07:00
committed by GitHub
parent fe003b927c
commit 9339e88a5a

View File

@@ -263,13 +263,13 @@ func (s *WebAuthnService) VerifyLogin(ctx context.Context, sessionID string, cre
return model.User{}, "", err
}
s.auditLogService.CreateNewSignInWithEmail(ctx, ipAddress, userAgent, user.ID, tx)
err = tx.Commit().Error
if err != nil {
return model.User{}, "", err
}
s.auditLogService.CreateNewSignInWithEmail(ctx, ipAddress, userAgent, user.ID, tx)
return *user, token, nil
}