From 4d32e763d1b0abd64af61b65d3c1dc0394d2e028 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 14 Jan 2024 18:16:55 -0600 Subject: [PATCH] Add sign-in server-side logging --- src/auth/SignInForm.tsx | 2 +- src/auth/{action.ts => actions.ts} | 2 ++ src/site/FooterClient.tsx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) rename src/auth/{action.ts => actions.ts} (89%) diff --git a/src/auth/SignInForm.tsx b/src/auth/SignInForm.tsx index c7f840b4..82c6b5be 100644 --- a/src/auth/SignInForm.tsx +++ b/src/auth/SignInForm.tsx @@ -4,7 +4,7 @@ import FieldSetWithStatus from '@/components/FieldSetWithStatus'; import InfoBlock from '@/components/InfoBlock'; import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus'; import { useLayoutEffect, useRef, useState } from 'react'; -import { signInAction } from './action'; +import { signInAction } from './actions'; import { useFormState } from 'react-dom'; import ErrorNote from '@/components/ErrorNote'; import { CREDENTIALS_SIGN_IN_ERROR } from '.'; diff --git a/src/auth/action.ts b/src/auth/actions.ts similarity index 89% rename from src/auth/action.ts rename to src/auth/actions.ts index c16db0bd..793c1540 100644 --- a/src/auth/action.ts +++ b/src/auth/actions.ts @@ -11,6 +11,8 @@ export const signInAction = async ( } catch (error) { if ((`${error}`).includes(CREDENTIALS_SIGN_IN_ERROR)) { return CREDENTIALS_SIGN_IN_ERROR; + } else { + console.log('Next Auth Error', error); } throw error; } diff --git a/src/site/FooterClient.tsx b/src/site/FooterClient.tsx index c26e0134..ab114e7c 100644 --- a/src/site/FooterClient.tsx +++ b/src/site/FooterClient.tsx @@ -9,7 +9,7 @@ import RepoLink from '../components/RepoLink'; import { usePathname } from 'next/navigation'; import { isPathAdmin, isPathSignIn, pathForAdminPhotos } from './paths'; import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus'; -import { signOutAction } from '@/auth/action'; +import { signOutAction } from '@/auth/actions'; import Spinner from '@/components/Spinner'; import AnimateItems from '@/components/AnimateItems';