naw man
This commit is contained in:
parent
3c8773efad
commit
f8d74b188f
1 changed files with 4 additions and 1 deletions
|
@ -22,7 +22,10 @@ export default authMiddleware({
|
|||
"/api/webhooks/(.*)",
|
||||
],
|
||||
afterAuth: async (auth, req) => {
|
||||
if (!auth.userId && auth.isPublicRoute) {
|
||||
const isAMA = auth.user?.emailAddresses.map((email) =>
|
||||
email.emailAddress.includes("ama.ab.ca")
|
||||
);
|
||||
if (!auth.userId && auth.isPublicRoute && !isAMA) {
|
||||
const { success } = await rateLimit.limit(req.ip || "");
|
||||
if (success) {
|
||||
return NextResponse.next();
|
||||
|
|
Loading…
Add table
Reference in a new issue