({
ctx,
}: InferProcedureOpts<typeof optionalAuthProcedure>)
| 8 | ); |
| 9 | |
| 10 | export async function logout({ |
| 11 | ctx, |
| 12 | }: InferProcedureOpts<typeof optionalAuthProcedure>) { |
| 13 | // Invalidate session |
| 14 | |
| 15 | if (ctx.sessionId != null) { |
| 16 | await ctx.dataAbstraction.patch('session', ctx.sessionId, { |
| 17 | invalidated: true, |
| 18 | }); |
| 19 | } |
| 20 | |
| 21 | // Clear cookies |
| 22 | |
| 23 | clearCookies(ctx.res); |
| 24 | } |
nothing calls this directly
no test coverage detected