-
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.
[fix]: mutliple re-rendering of toast on sign-in process
- Loading branch information
1 parent
8d64004
commit 25a111d
Showing
3 changed files
with
43 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { getServerSession } from "next-auth"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
import { authOptions } from "./config/authoptions"; | ||
import { getToken } from "next-auth/jwt"; | ||
// export { default } from "next-auth/middleware"; | ||
|
||
export async function middleware(req: NextRequest) { | ||
// const { url } = req; | ||
// const session = await getServerSession(authOptions); | ||
// const token = await getToken({req}); | ||
|
||
// console.log(token); | ||
|
||
// if (session && ["/signin"].includes(nextUrl.pathname)) { | ||
// return NextResponse.redirect("http://localhost:3000/"); | ||
// } | ||
|
||
// console.log(req); | ||
return NextResponse.next(); | ||
} | ||
|
||
// export const config = { matcher: ["/signin"] }; |