mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-02 22:26:57 -05:00
Remove THROW_ON_AUTH_ERROR
This commit is contained in:
parent
3c862d6e81
commit
6bfdfecd27
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user