From 75382944c3fa1645f60b6ec703e3eb284a061166 Mon Sep 17 00:00:00 2001 From: Angelo Reale <12191809+angeloreale@users.noreply.github.com> Date: Sat, 13 Jul 2024 21:37:53 +0100 Subject: [PATCH] ar(temp) auth stuff messy --- lib/auth/constants.ts | 7 ++++++- src/app/components/client/elements/signup-view.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/auth/constants.ts b/lib/auth/constants.ts index 69ec5f1d..4058092d 100644 --- a/lib/auth/constants.ts +++ b/lib/auth/constants.ts @@ -9,7 +9,12 @@ export const providers = [ const methods = { signIn: () => {}, - signOut: () => {}, + signOut: () => { + const response = await fetch('http://localhost:3000/api/auth/singout'); + const session = await response.json(); + console.log("requesting", { response: JSON.stringify(response) }); + return session; + }, getCsrf: async () => { const response = await fetch('http://localhost:3000/api/auth/csrf'); const csrf = await response.json(); diff --git a/src/app/components/client/elements/signup-view.tsx b/src/app/components/client/elements/signup-view.tsx index c1c10046..28a78a65 100644 --- a/src/app/components/client/elements/signup-view.tsx +++ b/src/app/components/client/elements/signup-view.tsx @@ -54,7 +54,7 @@ export const VSignUp = ({ providers, user }: VSignUpProps) => { /* server/client isomorphism */ - const coercedName = name || user?.name || user?.email; + const coercedName = name || user?.name || user?.email || "Young Padawan"; useEffect(() => { getCsrf().then((_csrf) => setCsrf(_csrf));