From 29f405290c7b711b22eb7f2a2683b35fece9922b Mon Sep 17 00:00:00 2001 From: m5r Date: Fri, 20 May 2022 00:29:12 +0200 Subject: [PATCH] fix redirect on `requireLoggedIn()` --- app/features/auth/actions/sign-in.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/features/auth/actions/sign-in.ts b/app/features/auth/actions/sign-in.ts index ba73a06..b36156f 100644 --- a/app/features/auth/actions/sign-in.ts +++ b/app/features/auth/actions/sign-in.ts @@ -15,8 +15,9 @@ const action: ActionFunction = async ({ request }) => { const searchParams = new URL(request.url).searchParams; const redirectTo = searchParams.get("redirectTo"); + const successRedirect = redirectTo ? decodeURIComponent(redirectTo) : null; const { email, password } = validation.data; - return authenticate({ email, password, request, successRedirect: redirectTo }); + return authenticate({ email, password, request, successRedirect }); }; export default action;