We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0097661 + 86b2542 commit 473b36eCopy full SHA for 473b36e
2 files changed
actions/user.ts
@@ -1,15 +1,14 @@
1
'use server';
2
3
import { cookies } from 'next/headers';
4
-import { redirect } from 'next/navigation';
5
6
export async function getUser() {
7
try {
8
const cookieStore = await cookies();
9
const token = cookieStore.get('session_token');
10
11
if (!token?.value) {
12
- redirect('/login');
+ return null;
13
}
14
15
const result = await fetch(
constants/routes.ts
@@ -11,6 +11,7 @@ export const ROUTES = {
};
export const PROTECTED_ROUTES = [
+ BASE_PATH,
ROUTES.HOME,
16
ROUTES.SCHEDULE,
17
ROUTES.CHATBOT,
0 commit comments