feat: logout for non secured

This commit is contained in:
Nevo David 2025-11-19 14:37:20 +07:00
parent 725ce402cf
commit 74d665691f
2 changed files with 4 additions and 1 deletions

View File

@ -199,6 +199,7 @@ export class UsersController {
@Post('/logout')
logout(@Res({ passthrough: true }) response: Response) {
response.header('logout', 'true');
response.cookie('auth', '', {
domain: getCookieUrlFromDomain(process.env.FRONTEND_URL!),
...(!process.env.NOT_SECURED

View File

@ -73,11 +73,13 @@ function LayoutContextInner(params: { children: ReactNode }) {
: '/analytics?onboarding=true';
return true;
}
if (response?.headers?.get('reload')) {
window.location.reload();
return true;
}
if (response.status === 401) {
if (response.status === 401 || response?.headers?.get('logout')) {
if (!isSecured) {
setCookie('auth', '', -10);
setCookie('showorg', '', -10);