Skip to content

Commit

Permalink
Removes bad condition check with /login url which dont exist
Browse files Browse the repository at this point in the history
  • Loading branch information
yelodevopsi committed Oct 16, 2023
1 parent 02096fb commit a93d00e
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 a93d00e

Please sign in to comment.