Skip to content

Commit bfb53bb

Browse files
Format
1 parent de50f77 commit bfb53bb

File tree

13 files changed

+239
-240
lines changed

13 files changed

+239
-240
lines changed

app/(auth)/auth.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import type { NextAuthConfig } from "next-auth";
1+
import type { NextAuthConfig } from 'next-auth';
22

33
export const authConfig = {
44
pages: {
5-
signIn: "/login",
6-
newUser: "/",
5+
signIn: '/login',
6+
newUser: '/',
77
},
88
providers: [
99
// added later in auth.ts since it requires bcrypt which is only compatible with Node.js
@@ -13,11 +13,11 @@ export const authConfig = {
1313
authorized({ auth, request: { nextUrl } }) {
1414
let isLoggedIn = !!auth?.user;
1515
// let isOnChat = nextUrl.pathname.startsWith("/");
16-
let isOnRegister = nextUrl.pathname.startsWith("/register");
17-
let isOnLogin = nextUrl.pathname.startsWith("/login");
16+
let isOnRegister = nextUrl.pathname.startsWith('/register');
17+
let isOnLogin = nextUrl.pathname.startsWith('/login');
1818

1919
if (isLoggedIn && (isOnLogin || isOnRegister)) {
20-
return Response.redirect(new URL("/", nextUrl as unknown as URL));
20+
return Response.redirect(new URL('/', nextUrl as unknown as URL));
2121
}
2222

2323
if (isOnRegister || isOnLogin) {

0 commit comments

Comments
 (0)