-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from hubcio2115/feat/migrate-to-next-auth-v5
Migrate to next-auth v5
- Loading branch information
Showing
9 changed files
with
83 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
import NextAuth from "next-auth"; | ||
import { handlers } from "~/server/auth"; | ||
|
||
import { authOptions } from "~/server/auth"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
const handler = NextAuth(authOptions); | ||
export { handler as GET, handler as POST }; | ||
export const { GET, POST } = handlers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
import { withAuth } from "next-auth/middleware"; | ||
import { auth } from "./server/auth"; | ||
|
||
export default withAuth({ | ||
callbacks: { | ||
authorized: ({ req }) => { | ||
const token = req.cookies.get("next-auth.session-token")?.value; | ||
export default auth; | ||
|
||
if (token) return true; | ||
return false; | ||
}, | ||
}, | ||
}); | ||
|
||
export const config = { matcher: ["/dashboard"] }; | ||
export const config = { matcher: ["/dashboard", "/api/projects/"] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters