bugfixing redirect correctyl after login/register

This commit is contained in:
MuslemRahimi 2024-06-14 14:46:35 +02:00
parent 0ad720f3f7
commit 368886d145
4 changed files with 4 additions and 17 deletions

View File

@ -95,9 +95,6 @@ export const actions = {
maxAge: 60
});
oauthState.update( value => state);
oauthVerifier.update( value => verifier);
oauthProvider.update( value => providerSelected);
redirect(302,authProviderRedirect);

View File

@ -71,13 +71,12 @@ export const GET = async ({locals, url, cookies}) => {
}
try {
const path = cookies?.get('path');
redirect(301, path?.length !== 0 ? path : "/");
} catch(e) {
if(cookies?.get('path')) {
redirect(301, cookies?.get('path'));
} else {
redirect(301,"/");
}
//Login user automatically
//const avatarUrl = newUser['meta']['avatarUrl'];

View File

@ -1,8 +1,6 @@
import { error, fail, redirect } from "@sveltejs/kit";
import { validateData } from "$lib/utils";
import { loginUserSchema, registerUserSchema } from "$lib/schemas";
import { oauthState, oauthVerifier, oauthProvider } from '$lib/store';
export const actions = {
@ -129,9 +127,6 @@ export const actions = {
maxAge: 60
});
oauthState.update( value => state);
oauthVerifier.update( value => verifier);
oauthProvider.update( value => providerSelected);
redirect(302,authProviderRedirect);

View File

@ -1,7 +1,6 @@
import { error, fail, redirect } from '@sveltejs/kit';
import { registerUserSchema } from '$lib/schemas';
import { validateData } from '$lib/utils';
import { oauthState, oauthVerifier, oauthProvider } from '$lib/store';
@ -104,9 +103,6 @@ export const actions = {
maxAge: 60
});
oauthState.update( value => state);
oauthVerifier.update( value => verifier);
oauthProvider.update( value => providerSelected);
redirect(302,authProviderRedirect);