nextjs-redux-firebase-authentication icon indicating copy to clipboard operation
nextjs-redux-firebase-authentication copied to clipboard

Account Page Crashes On Signout

Open freddiemixell opened this issue 6 years ago • 1 comments

Expected Behavior

Account Page should redirect to sign in page when sign out button is clicked.

Current Behavior

Signing out from the account page causes the app to crash.

Possible Solution

Checking to see if the authUser is null and if it is returning null instead of the component.

Steps to Reproduce

  1. Sign in
  2. Navigate to Account Page
  3. Sign out
  4. App crashed authUser.email undefined.

freddiemixell avatar Jul 28 '19 01:07 freddiemixell

const AccountPage = ({ authUser }) => { if ( null === authUser ) { return null; } return ( <AppWithAuthorization> <h1>Account: {authUser.email}</h1> <PasswordForgetForm /> <PasswordChangeForm /> </AppWithAuthorization> ); };

freddiemixell avatar Jul 28 '19 01:07 freddiemixell