Skip to content

Commit da41e1e

Browse files
committed
fix
1 parent fe859f6 commit da41e1e

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

packages/auth/src/config.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ export const authConfig: NextAuthConfig = {
2020
},
2121
}),
2222
],
23+
basePath: "/portal/api/auth",
2324
pages: {
24-
signIn: "/",
25-
error: "/auth/error",
25+
signIn: "/portal",
26+
error: "/portal/auth/error",
2627
},
2728
callbacks: {
2829
async session({ session, user }) {
@@ -33,14 +34,13 @@ export const authConfig: NextAuthConfig = {
3334
return session;
3435
},
3536
async redirect({ url, baseUrl }) {
36-
// Handle callback URLs - allow /dashboard, /judge, etc.
37-
if (url.includes('/dashboard') || url.includes('/judge') || url.includes('/admin') || url.includes('/club')) {
38-
// Extract the path and append to baseUrl
39-
const path = new URL(url, baseUrl).pathname;
40-
return `${baseUrl}${path}`;
37+
// Handle callback URLs - allow /portal/*
38+
if (url.startsWith("/")) {
39+
return `${baseUrl}${url}`;
40+
} else if (new URL(url).origin === baseUrl) {
41+
return url;
4142
}
42-
// Default to dashboard after sign-in
43-
return `${baseUrl}/dashboard`;
43+
return baseUrl;
4444
},
4545
},
4646
session: {

sites/mainweb/components/Navbar/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export default function Navbar({ screen_width, page, className = "" }: NavbarPro
117117
href="/portal"
118118
rel="noopener noreferrer"
119119
className="px-5 py-2 bg-white text-black text-[10px] font-mono font-bold uppercase tracking-widest rounded-sm hover:bg-[#00A8A8] hover:text-white transition-all duration-300"
120+
onClick={() => setMenuOpen(false)}
120121
>
121122
Portal
122123
</Link>
@@ -148,6 +149,7 @@ export default function Navbar({ screen_width, page, className = "" }: NavbarPro
148149
href="/portal"
149150
rel="noopener noreferrer"
150151
className="mt-4 px-10 py-4 bg-white text-black text-sm font-mono font-bold uppercase tracking-[0.3em] rounded-sm shadow-[0_0_20px_rgba(255,255,255,0.1)]"
152+
onClick={() => setMenuOpen(false)}
151153
>
152154
Portal
153155
</Link>

0 commit comments

Comments
 (0)