Initial commit for project Spoon!
Build and Push Next App / quality (push) Failing after 45s
Build and Push Next App / build-next (push) Has been skipped

This commit is contained in:
Gabriel Brown
2026-06-21 17:52:02 -05:00
commit cf7ff2ee4e
268 changed files with 32981 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import {
convexAuthNextjsMiddleware,
createRouteMatcher,
nextjsMiddlewareRedirect,
} from '@convex-dev/auth/nextjs/server';
const isAuthRoute = createRouteMatcher(['/sign-in', '/forgot-password']);
const isProtectedRoute = createRouteMatcher([
'/dashboard(.*)',
'/spoons(.*)',
'/updates(.*)',
'/agents(.*)',
'/profile(.*)',
]);
export default convexAuthNextjsMiddleware(
async (request, { convexAuth }) => {
const isAuthenticated = await convexAuth.isAuthenticated();
if (isAuthRoute(request) && isAuthenticated) {
return nextjsMiddlewareRedirect(request, '/dashboard');
}
if (isProtectedRoute(request) && !isAuthenticated) {
return nextjsMiddlewareRedirect(request, '/sign-in');
}
},
{ cookieConfig: { maxAge: 60 * 60 * 24 * 30 } },
);
export const config = {
matcher: [
'/((?!_next/static|_next/image|favicon.ico|monitoring-tunnel|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
'/((?!.*\\..*|_next).*)',
'/',
'/(api)(.*)',
],
};