@@ -388,8 +388,7 @@ func (p *Persister) ConfirmLoginSession(ctx context.Context, loginSession *flow.
388
388
return p .mySQLConfirmLoginSession (ctx , loginSession )
389
389
}
390
390
391
- err = p .Connection (ctx ).Transaction (func (tx * pop.Connection ) error {
392
- res , err := tx .TX .NamedExec (`
391
+ res , err := p .Connection (ctx ).Store .NamedExecContext (ctx , `
393
392
INSERT INTO hydra_oauth2_authentication_session (id, nid, authenticated_at, subject, remember, identity_provider_session_id)
394
393
VALUES (:id, :nid, :authenticated_at, :subject, :remember, :identity_provider_session_id)
395
394
ON CONFLICT(id) DO
@@ -400,22 +399,16 @@ UPDATE SET
400
399
identity_provider_session_id = :identity_provider_session_id
401
400
WHERE hydra_oauth2_authentication_session.id = :id AND hydra_oauth2_authentication_session.nid = :nid
402
401
` , loginSession )
403
- if err != nil {
404
- return sqlcon .HandleError (err )
405
- }
406
- n , err := res .RowsAffected ()
407
- if err != nil {
408
- return sqlcon .HandleError (err )
409
- }
410
- if n == 0 {
411
- return errorsx .WithStack (x .ErrNotFound )
412
- }
413
- return nil
414
- })
415
402
if err != nil {
416
- return errors .WithStack (err )
403
+ return sqlcon .HandleError (err )
404
+ }
405
+ n , err := res .RowsAffected ()
406
+ if err != nil {
407
+ return sqlcon .HandleError (err )
408
+ }
409
+ if n == 0 {
410
+ return errorsx .WithStack (x .ErrNotFound )
417
411
}
418
-
419
412
return nil
420
413
}
421
414
0 commit comments