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