From 6bfdfecd27484a148d545afd7f8b8ab97efdb171 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 28 Sep 2023 21:25:07 +0300 Subject: [PATCH] Remove THROW_ON_AUTH_ERROR --- app/modules/auth/routes.server.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/modules/auth/routes.server.ts b/app/modules/auth/routes.server.ts index 98a45a5ba..f2c864650 100644 --- a/app/modules/auth/routes.server.ts +++ b/app/modules/auth/routes.server.ts @@ -18,8 +18,6 @@ import { deleteLogInLinkByCode } from "./queries/deleteLogInLinkByCode.server"; import { db } from "~/db"; import isbot from "isbot"; -const throwOnAuthErrors = process.env["THROW_ON_AUTH_ERROR"] === "true"; - export const callbackLoader: LoaderFunction = async ({ request }) => { const url = new URL(request.url); if (url.searchParams.get("error") === "access_denied") { @@ -33,8 +31,7 @@ export const callbackLoader: LoaderFunction = async ({ request }) => { await authenticator.authenticate(DISCORD_AUTH_KEY, request, { successRedirect: "/", - failureRedirect: throwOnAuthErrors ? undefined : authErrorUrl("unknown"), - throwOnError: throwOnAuthErrors, + failureRedirect: authErrorUrl("unknown"), }); throw new Response("Unknown authentication state", { status: 500 });