mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-01-31 00:53:37 +00:00
Removed Old Middleware
This commit is contained in:
parent
d0722bd650
commit
7127644c9e
1 changed files with 0 additions and 25 deletions
|
@ -8,28 +8,3 @@ export default clerkMiddleware();
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
|
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Old Middleware
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* import { authMiddleware, redirectToSignIn } from '@clerk/nextjs';
|
|
||||||
import { NextResponse } from 'next/server';
|
|
||||||
|
|
||||||
export default authMiddleware({
|
|
||||||
publicRoutes: ['/', '/api/webhook', '/privacy-policy', '/terms-of-service'],
|
|
||||||
afterAuth(auth, req) {
|
|
||||||
if (!auth.userId && !auth.isPublicRoute) {
|
|
||||||
return redirectToSignIn({ returnBackUrl: req.url });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auth.userId && !auth.orgId && req.nextUrl.pathname !== '/select-org') {
|
|
||||||
const orgSelection = new URL('/select-org', req.url);
|
|
||||||
return NextResponse.redirect(orgSelection);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const config = {
|
|
||||||
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
|
|
||||||
}; */
|
|
||||||
|
|
Loading…
Reference in a new issue