Created
May 5, 2024 04:57
-
-
Save royce-mathew/f5c02b4a42417246d8df1d34c05ec179 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { auth } from "@/auth" | |
export default auth((req) => { | |
if (!req.auth) { | |
const url = req.url.replace(req.nextUrl.pathname, "/login") | |
return Response.redirect(url) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment