diff --git a/src/lib/router-helpers.ts b/src/lib/router-helpers.ts index f80f4ab..84bec63 100644 --- a/src/lib/router-helpers.ts +++ b/src/lib/router-helpers.ts @@ -77,3 +77,16 @@ export const catchAllRoute: RouteRecordRaw = { path: '/:pathMatch(.*)*', redirect: '/', } + +/** + * Where to send the user after a successful login. Honours a `?redirect=` + * query param so a page can bounce an anonymous user through /login and + * back (e.g. chatelet's Book button). Only same-origin absolute paths are + * accepted — anything else (external URLs, protocol-relative `//host`) + * falls back to home. + */ +export function postLoginTarget(redirect: unknown): string { + if (typeof redirect !== 'string') return '/' + if (!redirect.startsWith('/') || redirect.startsWith('//')) return '/' + return redirect +} diff --git a/src/modules/chatelet/components/BookRoomDialog.vue b/src/modules/chatelet/components/BookRoomDialog.vue new file mode 100644 index 0000000..61381ff --- /dev/null +++ b/src/modules/chatelet/components/BookRoomDialog.vue @@ -0,0 +1,353 @@ + + +