(ctx context.Context, id string)
| 240 | } |
| 241 | |
| 242 | func (p *Persister) DeleteLoginSession(ctx context.Context, id string) (_ *flow.LoginSession, err error) { |
| 243 | ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.DeleteLoginSession") |
| 244 | defer otelx.End(span, &err) |
| 245 | |
| 246 | c := p.Connection(ctx) |
| 247 | if c.Dialect.Name() == "mysql" { |
| 248 | // MySQL does not support RETURNING. |
| 249 | return p.mySQLDeleteLoginSession(ctx, id) |
| 250 | } |
| 251 | |
| 252 | var session flow.LoginSession |
| 253 | columns := popx.DBColumns[flow.LoginSession](c.Dialect) |
| 254 | if err := p.Connection(ctx).RawQuery( |
| 255 | fmt.Sprintf(`DELETE FROM hydra_oauth2_authentication_session WHERE id = ? AND nid = ? RETURNING %s`, columns), |
| 256 | id, |
| 257 | p.NetworkID(ctx), |
| 258 | ).First(&session); err != nil { |
| 259 | return nil, sqlcon.HandleError(err) |
| 260 | } |
| 261 | |
| 262 | return &session, nil |
| 263 | } |
| 264 | |
| 265 | func (p *Persister) mySQLDeleteLoginSession(ctx context.Context, id string) (_ *flow.LoginSession, err error) { |
| 266 | ctx, span := p.r.Tracer(ctx).Tracer().Start(ctx, "persistence.sql.mySQLDeleteLoginSession") |
nothing calls this directly
no test coverage detected