Skip to content

Commit

Permalink
Fix meta description
Browse files Browse the repository at this point in the history
  • Loading branch information
vhande committed Nov 14, 2024
1 parent b2ba463 commit 7a2bf88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 0 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ const { withSentryConfig } = require('@sentry/nextjs');
const moduleExports = {
productionBrowserSourceMaps: true,
swcMinify: true,
async redirects() {
// Redirects to fix non-existing paths should go in `src/redirects.js`!!!
const env = process.env.NEXT_PUBLIC_ENVIRONMENT;
return [
{
source: '/',
destination: '/dashboard',
permanent: env !== 'development',
},
];
},
async rewrites() {
return [
{
Expand Down
9 changes: 9 additions & 0 deletions src/middleware.api.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import { Cookies } from 'react-cookie';

import { getAuthEdgeServer } from '@/auth/edge';

import { defaultCookieOptions } from './hooks/useCookiesWithOptions';
import { isTokenValid } from './utils/isTokenValid';

const authEdgeServer = getAuthEdgeServer();

export const middleware = async (request: NextRequest) => {
if (request.nextUrl.pathname === '/') {
const token = request.cookies.get('token');
if (isTokenValid(token)) {
return NextResponse.redirect(`${request.nextUrl.origin}/dashboard`);
}
}
if (request.nextUrl.pathname.startsWith('/login')) {
const referer = request.cookies.get('auth0.redirect_uri');

Expand Down Expand Up @@ -83,6 +91,7 @@ export const middleware = async (request: NextRequest) => {

export const config = {
matcher: [
'/',
'/event',
'/login',
'/organizers/:id/ownerships',
Expand Down

0 comments on commit 7a2bf88

Please sign in to comment.