Skip to content

Commit

Permalink
Token, login, and re-auth fix (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
yelodevopsi authored Oct 16, 2023
1 parent 02096fb commit 5121a98
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions frontend/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { withAuth } from "next-auth/middleware";

export default withAuth({
callbacks: {
authorized: ({ req, token }) => {
return (
(!!token && !req.nextUrl.basePath.startsWith("/login")) ||
!!process.env.NEXT_PUBLIC_NO_AUTH
);
authorized: ({ token }) => {
return !!token || !!process.env.NEXT_PUBLIC_NO_AUTH;
},
},
});

0 comments on commit 5121a98

Please sign in to comment.