fix redirect on requireLoggedIn()

This commit is contained in:
m5r 2022-05-20 00:29:12 +02:00
parent 9c9b4a5af4
commit 29f405290c

View File

@ -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;