diff --git a/src/lib/components/UserHeader.svelte b/src/lib/components/UserHeader.svelte index 65a87b8..15593ff 100644 --- a/src/lib/components/UserHeader.svelte +++ b/src/lib/components/UserHeader.svelte @@ -139,10 +139,10 @@ h2 + p{

({user.nickname})

{:else} - Log In + Log In {/if} diff --git a/src/routes/(main)/login/+page.server.ts b/src/routes/(main)/login/+page.server.ts deleted file mode 100644 index 5ac7b62..0000000 --- a/src/routes/(main)/login/+page.server.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { signIn } from "../../../auth" -import type { Actions } from "./$types" -export const actions: Actions = { default: signIn } diff --git a/src/routes/(main)/logout/+page.server.ts b/src/routes/(main)/logout/+page.server.ts deleted file mode 100644 index 5ac7b62..0000000 --- a/src/routes/(main)/logout/+page.server.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { signIn } from "../../../auth" -import type { Actions } from "./$types" -export const actions: Actions = { default: signIn } diff --git a/src/routes/login/+server.ts b/src/routes/login/+server.ts new file mode 100644 index 0000000..f0a20fe --- /dev/null +++ b/src/routes/login/+server.ts @@ -0,0 +1,35 @@ +import type { RequestHandler } from './$types'; + +export const GET: RequestHandler = async ({ url }) => { + const callbackUrl = url.searchParams.get('callbackUrl') || '/'; + + // Create an auto-submitting form that POSTs to Auth.js signin + const html = ` + + + + Redirecting to login... + + + +

Redirecting to login...

+
+
+ +
+ + +`; + + return new Response(html, { + headers: { + 'Content-Type': 'text/html' + } + }); +}; \ No newline at end of file diff --git a/src/routes/logout/+server.ts b/src/routes/logout/+server.ts new file mode 100644 index 0000000..ab301f8 --- /dev/null +++ b/src/routes/logout/+server.ts @@ -0,0 +1,35 @@ +import type { RequestHandler } from './$types'; + +export const GET: RequestHandler = async ({ url }) => { + const callbackUrl = url.searchParams.get('callbackUrl') || '/'; + + // Create an auto-submitting form that POSTs to Auth.js signout + const html = ` + + + + Signing out... + + + +

Signing out...

+
+
+ +
+ + +`; + + return new Response(html, { + headers: { + 'Content-Type': 'text/html' + } + }); +}; \ No newline at end of file