Skip to content

Commit

Permalink
Merge branch 'rc'
Browse files Browse the repository at this point in the history
* rc:
  fix unauthenticated users getting stuck on ProtectedRoutes
  • Loading branch information
notsidney committed Apr 8, 2022
2 parents fba88cd + 263ea5a commit 5a6f464
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/contexts/AppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const AppProvider: React.FC = ({ children }) => {
};
useEffect(() => {
auth.onAuthStateChanged((auth) => {
if (auth)
if (auth) {
auth.getIdTokenResult(true).then((results) => {
setCurrentUser(auth);
setAuthToken(results.token);
Expand All @@ -90,6 +90,9 @@ export const AppProvider: React.FC = ({ children }) => {
);
setUserClaims(results.claims);
});
} else {
setCurrentUser(auth);
}
});
}, []);

Expand Down

1 comment on commit 5a6f464

@vercel
Copy link

@vercel vercel bot commented on 5a6f464 May 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rowy-dev – ./

rowy-dev.vercel.app
rowy-dev-rowy.vercel.app
rowy-dev-git-main-rowy.vercel.app

Please sign in to comment.