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}) => {
} }
const path = cookies?.get('path'); try {
redirect(301, path?.length !== 0 ? path : "/"); const path = cookies?.get('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

@ -96,6 +96,13 @@ export const actions = {
path: '/', path: '/',
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);

File diff suppressed because one or more lines are too long