bugfixing redirect correctyl after login/register
This commit is contained in:
parent
0ad720f3f7
commit
368886d145
@ -95,9 +95,6 @@ export const actions = {
|
||||
maxAge: 60
|
||||
});
|
||||
|
||||
oauthState.update( value => state);
|
||||
oauthVerifier.update( value => verifier);
|
||||
oauthProvider.update( value => providerSelected);
|
||||
|
||||
|
||||
redirect(302,authProviderRedirect);
|
||||
|
||||
@ -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'];
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user