feat(frontend): added logout page

This commit is contained in:
Maieul BOYER 2025-12-12 15:49:47 +01:00
parent 4a56c92667
commit 8222ec4ea3
No known key found for this signature in database
3 changed files with 20 additions and 0 deletions

View file

@ -1,5 +1,8 @@
import { showError } from "@app/toast";
import client from '@app/api';
import cookie from 'js-cookie';
cookie.remove('pkce');
export type User = {
id: string;

View file

@ -5,6 +5,7 @@ import './login/login.ts'
import './signin/signin.ts'
import './ttt/ttt.ts'
import './profile/profile.ts'
import './logout/logout.ts'
// ---- Initial load ----
setTitle("");

View file

@ -0,0 +1,16 @@
import { addRoute, navigateTo, setTitle, type RouteHandlerReturn } from "@app/routing";
import cookie from "js-cookie";
async function route(_url: string, _args: { [k: string]: string }): Promise<RouteHandlerReturn> {
setTitle('Logout')
return {
html: "you should have been logged out", postInsert: async (app) => {
cookie.remove("token");
navigateTo("/");
}
};
}
addRoute('/logout', route, { bypass_auth: true })