Skip to content

Commit

Permalink
ar(temp) auth stuff messy
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Jul 13, 2024
1 parent 42d3f26 commit 7538294
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/auth/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/client/elements/signup-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 7538294

Please sign in to comment.