mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix: cookie setting by only setting on admin routes
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user