Merge pull request #212 from appwrite/fix-accept-invite-logged-user

fix: accept invite while logged in
This commit is contained in:
Torsten Dittmann
2022-12-27 10:42:07 +01:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -4,6 +4,7 @@
import LoginDark from '$lib/images/login/login-dark-mode.svg';
import { app } from '$lib/stores/app';
import { base } from '$app/paths';
import { user } from '$lib/stores/user';
const technologies = [
'js',
@@ -25,7 +26,7 @@
<div
class="container u-margin-block-start-20"
style="--p-container-max-size: var(--container-size-medium);">
<a href="/">
<a href={user ? '/console' : '/'}>
<img src={AppwriteLogo} width="196" height="47" class="u-block" alt="Appwrite" />
</a>
</div>
+6 -1
View File
@@ -49,11 +49,16 @@
if (!$page.url.pathname.startsWith('/auth')) {
const acceptedRoutes = ['/login', '/register', '/recover', '/invite'];
if ($user) {
if (!$page.url.pathname.startsWith('/console')) {
if (
!$page.url.pathname.startsWith('/console') &&
!$page.url.pathname.startsWith('/invite')
) {
console.log('test');
await goto(`${base}/console`, {
replaceState: true
});
}
loading.set(false);
} else {
if (acceptedRoutes.includes($page.url.pathname)) {
await goto(`${base}${$page.url.pathname}${$page.url.search}`);