feat(frontend): added returnTo to login and signin page
This commit is contained in:
parent
033d399fcb
commit
b1d4f68453
14 changed files with 352 additions and 1460 deletions
|
|
@ -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 })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue