fix: cookie setting by only setting on admin routes

This commit is contained in:
dswbx
2025-06-03 13:04:03 +02:00
parent 50cadbaa8e
commit 15a9c549e7
6 changed files with 270 additions and 59 deletions

View File

@@ -121,6 +121,7 @@ export class AuthController extends Controller {
const claims = c.get("auth")?.user;
if (claims) {
const { data: user } = await this.userRepo.findId(claims.id);
await this.auth.authenticator?.requestCookieRefresh(c);
return c.json({ user });
}

View File

@@ -60,11 +60,7 @@ export const auth = (options?: {
}
await next();
if (!skipped) {
// renew cookie if applicable
authenticator?.requestCookieRefresh(c);
}
// @todo: potentially add cookie refresh if content-type html and about to expire
// release
authCtx.skip = false;