update login/register page && bugfixing error 500 in register page

This commit is contained in:
MuslemRahimi 2024-06-14 14:38:44 +02:00
parent d33fd58ecf
commit 0ad720f3f7
4 changed files with 83 additions and 89 deletions

File diff suppressed because one or more lines are too long

View File

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

View File

@ -97,6 +97,13 @@ export const actions = {
maxAge: 60*60 maxAge: 60*60
}); });
cookies.set('path', "/", {httpOnly: true,
sameSite: 'lax',
secure: true,
path: '/',
maxAge: 60
});
oauthState.update( value => state); oauthState.update( value => state);
oauthVerifier.update( value => verifier); oauthVerifier.update( value => verifier);
oauthProvider.update( value => providerSelected); oauthProvider.update( value => providerSelected);

File diff suppressed because one or more lines are too long