mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-26 05:12:19 -05:00
Remove THROW_ON_AUTH_ERROR
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user