Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyphilemon committed Nov 19, 2024
1 parent de50f77 commit bfb53bb
Show file tree
Hide file tree
Showing 13 changed files with 239 additions and 240 deletions.
12 changes: 6 additions & 6 deletions app/(auth)/auth.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { NextAuthConfig } from "next-auth";
import type { 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
Expand All @@ -13,11 +13,11 @@ export const authConfig = {
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 isOnRegister = nextUrl.pathname.startsWith('/register');
let isOnLogin = nextUrl.pathname.startsWith('/login');

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

if (isOnRegister || isOnLogin) {
Expand Down
Loading

0 comments on commit bfb53bb

Please sign in to comment.