Add sign-in server-side logging

This commit is contained in:
Sam Becker 2024-01-14 18:16:55 -06:00
parent 4f0a43e9e2
commit 4d32e763d1
3 changed files with 4 additions and 2 deletions

View File

@ -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 '.';

View File

@ -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;
}

View File

@ -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';