diff --git a/package-lock.json b/package-lock.json index 330a768fc1..28412f8d9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2940,9 +2940,9 @@ } }, "node_modules/devalue": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.0.0.tgz", - "integrity": "sha512-w25siwXyuMUqMr7jPlEjyNCp1vn0Jzj/fNg3qVt/r/Dpe8HjESh2V92L0jmh3uq4iJt0BvjH+Azk1pQzkcnDWA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.2.0.tgz", + "integrity": "sha512-mbjoAaCL2qogBKgeFxFPOXAUsZchircF+B/79LD4sHH0+NHfYm8gZpQrskKDn5gENGt35+5OI1GUF7hLVnkPDw==", "dev": true }, "node_modules/dir-glob": { @@ -9931,9 +9931,9 @@ "peer": true }, "devalue": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.0.0.tgz", - "integrity": "sha512-w25siwXyuMUqMr7jPlEjyNCp1vn0Jzj/fNg3qVt/r/Dpe8HjESh2V92L0jmh3uq4iJt0BvjH+Azk1pQzkcnDWA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.2.0.tgz", + "integrity": "sha512-mbjoAaCL2qogBKgeFxFPOXAUsZchircF+B/79LD4sHH0+NHfYm8gZpQrskKDn5gENGt35+5OI1GUF7hLVnkPDw==", "dev": true }, "dir-glob": { diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 38d8f5f475..a2e1ef2a34 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -46,23 +46,25 @@ /** * Handle initial load. */ - const acceptedRoutes = ['/login', '/register', '/recover', '/invite']; - if ($user) { - if (!$page.url.pathname.startsWith('/console')) { - await goto(`${base}/console`, { - replaceState: true - }); - } - } else { - if (acceptedRoutes.includes($page.url.pathname)) { - await goto(`${base}${$page.url.pathname}${$page.url.search}`); + if (!$page.url.pathname.startsWith('/auth')) { + const acceptedRoutes = ['/login', '/register', '/recover', '/invite']; + if ($user) { + if (!$page.url.pathname.startsWith('/console')) { + await goto(`${base}/console`, { + replaceState: true + }); + } } else { - await goto(`${base}/login`, { - replaceState: true - }); + if (acceptedRoutes.includes($page.url.pathname)) { + await goto(`${base}${$page.url.pathname}${$page.url.search}`); + } else { + await goto(`${base}/login`, { + replaceState: true + }); + } } - loading.set(false); } + loading.set(false); }); afterNavigate((navigation) => { diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index b568c02099..4544b5beb0 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -8,6 +8,9 @@ import type { LayoutLoad } from './$types'; export const ssr = false; export const load: LayoutLoad = async ({ depends, url }) => { + if (url.pathname.startsWith('/auth')) { + return; + } depends(Dependencies.ACCOUNT); try { const account = await sdkForConsole.account.get(); diff --git a/src/routes/auth/+layout.svelte b/src/routes/auth/+layout.svelte new file mode 100644 index 0000000000..681bf416d2 --- /dev/null +++ b/src/routes/auth/+layout.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/src/routes/auth/magic-url/+page.svelte b/src/routes/auth/magic-url/+page.svelte new file mode 100644 index 0000000000..cd4c25e3f8 --- /dev/null +++ b/src/routes/auth/magic-url/+page.svelte @@ -0,0 +1,29 @@ + + +Missing Redirect URL +

+ Your Magic URL login flow is missing a proper redirect URL. Please check the + Magic URL docs + and send request for new session with a valid redirect URL. +

diff --git a/src/routes/auth/oauth/failure/+page.svelte b/src/routes/auth/oauth/failure/+page.svelte new file mode 100644 index 0000000000..359c6ffdca --- /dev/null +++ b/src/routes/auth/oauth/failure/+page.svelte @@ -0,0 +1,21 @@ + + +Missing Redirect URL +

+ Your OAuth login flow is missing a proper redirect URL. Please check the + OAuth docs + and send request for new session with a valid callback URL. +

diff --git a/src/routes/auth/oauth/success/+page.svelte b/src/routes/auth/oauth/success/+page.svelte new file mode 100644 index 0000000000..359c6ffdca --- /dev/null +++ b/src/routes/auth/oauth/success/+page.svelte @@ -0,0 +1,21 @@ + + +Missing Redirect URL +

+ Your OAuth login flow is missing a proper redirect URL. Please check the + OAuth docs + and send request for new session with a valid callback URL. +