We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a69a675 commit 9541067Copy full SHA for 9541067
src/utils/auth.ts
@@ -4,11 +4,15 @@ import { LOGIN_USER, REFRESH_AUTH_TOKEN } from './gql/GQL_MUTATIONS';
4
let tokenSetter: ReturnType<typeof setInterval>;
5
6
export function hasCredentials() {
7
+ if (typeof window === 'undefined') {
8
+ return false; // Server-side, no credentials available
9
+ }
10
+
11
const authToken = sessionStorage.getItem(
- process.env.NEXT_PUBLIC_AUTH_TOKEN_SS_KEY as string,
12
+ process.env.NEXT_PUBLIC_AUTH_TOKEN_SS_KEY as string
13
);
14
const refreshToken = localStorage.getItem(
- process.env.NEXT_PUBLIC_REFRESH_TOKEN_LS_KEY as string,
15
+ process.env.NEXT_PUBLIC_REFRESH_TOKEN_LS_KEY as string
16
17
18
if (!!authToken && !!refreshToken) {
0 commit comments