feat: allow to disable auth during development (#21)

This commit is contained in:
Dominic Elm
2024-07-30 10:31:35 +02:00
committed by GitHub
parent 4df1da4908
commit 58af0dea8c
6 changed files with 11 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
import { createCookieSessionStorage, redirect } from '@remix-run/cloudflare';
import { decodeJwt } from 'jose';
import { request as doRequest } from '~/lib/fetch';
import { CLIENT_ID, CLIENT_ORIGIN } from '~/lib/constants';
import { request as doRequest } from '~/lib/fetch';
import { logger } from '~/utils/logger';
const DEV_SESSION_SECRET = import.meta.env.DEV ? 'LZQMrERo3Ewn/AbpSYJ9aw==' : undefined;
@@ -33,7 +33,7 @@ export async function isAuthenticated(request: Request, env: Env) {
try {
data = await refreshToken(token);
} catch {
// ignore
// we can ignore the error here because it's handled below
}
if (data != null) {