From 4880e0d94e5d5c3c67a3774ffc7f4b482afb9172 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Tue, 5 Nov 2024 09:35:04 -0500 Subject: [PATCH] Fix typescript errors --- app/(auth)/auth.config.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/(auth)/auth.config.ts b/app/(auth)/auth.config.ts index 7e27788..1a910a3 100644 --- a/app/(auth)/auth.config.ts +++ b/app/(auth)/auth.config.ts @@ -1,9 +1,9 @@ -import { NextAuthConfig } from "next-auth"; +import { NextAuthConfig } from 'next-auth'; export const authConfig = { pages: { - signIn: "/login", - newUser: "/", + signIn: '/login', + newUser: '/', }, providers: [ // added later in auth.ts since it requires bcrypt which is only compatible with Node.js @@ -12,12 +12,12 @@ export const authConfig = { callbacks: { authorized({ auth, request: { nextUrl } }) { let isLoggedIn = !!auth?.user; - let isOnChat = nextUrl.pathname.startsWith("/"); - let isOnRegister = nextUrl.pathname.startsWith("/register"); - let isOnLogin = nextUrl.pathname.startsWith("/login"); + let isOnChat = nextUrl.pathname.startsWith('/'); + let isOnRegister = nextUrl.pathname.startsWith('/register'); + let isOnLogin = nextUrl.pathname.startsWith('/login'); if (isLoggedIn && (isOnLogin || isOnRegister)) { - return Response.redirect(new URL("/", nextUrl)); + return Response.redirect(new URL('/', nextUrl as unknown as URL)); } if (isOnRegister || isOnLogin) { @@ -30,7 +30,7 @@ export const authConfig = { } if (isLoggedIn) { - return Response.redirect(new URL("/", nextUrl)); + return Response.redirect(new URL('/', nextUrl as unknown as URL)); } return true;