??????
This commit is contained in:
parent
f20507bbec
commit
045bf8e5dc
1 changed files with 14 additions and 0 deletions
|
@ -33,6 +33,20 @@ export default authMiddleware({
|
|||
});
|
||||
}
|
||||
|
||||
if (auth.userId && !auth.isPublicRoute) {
|
||||
const isAMA = auth.user?.emailAddresses.map((email) =>
|
||||
email.emailAddress.includes("ama.ab.ca")
|
||||
);
|
||||
|
||||
console.log("ISAMA: ", isAMA);
|
||||
|
||||
if (isAMA && isAMA?.length > 0) {
|
||||
return NextResponse.redirect(
|
||||
"https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (req.nextUrl.pathname.includes("/api/internal")) {
|
||||
const { success } = await rateLimit.limit(req.ip || "");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue