feat(frontend): added returnTo to login and signin page

This commit is contained in:
Maieul BOYER 2025-11-14 21:59:25 +01:00 committed by Maix0
parent 033d399fcb
commit b1d4f68453
14 changed files with 352 additions and 1460 deletions

View file

@ -1,14 +1,19 @@
import { addRoute, setTitle, type RouteHandlerParams } from "@app/routing";
import page from './root.html?raw'
import { updateUser } from "@app/auth";
addRoute('/', (_: string) => {
setTitle('ft boules')
addRoute('/', async (_: string): Promise<string> => {
let user = await updateUser();
if (user === null)
setTitle(`Welcome`)
else
setTitle(`Welcome ${user.guest ? '[GUEST] ' : ''}${user.name}`);
return page;
})
}, { bypass_auth: true })
addRoute('/with_title/:title', (_: string, args: RouteHandlerParams) => {
setTitle(args.title)
console.log(`title should be '${args.title}'`);
return page;
})
}, { bypass_auth: false })