Skip to content

Commit

Permalink
tweak unauth logic on AuthProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
ikethecoder committed Dec 1, 2021
1 parent a474dc9 commit 7259689
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nextapp/shared/services/auth/auth-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
const route = links.find(
(d) => d.url === router?.pathname || d.altUrls?.includes(router?.pathname)
);
const isUnauthorized = session.error && route?.access.length > 0;
const isUnauthorized =
(session.error || !session.user) && route?.access.length > 0;

if (session.status == 'loading') {
return <></>;
Expand Down

0 comments on commit 7259689

Please sign in to comment.