login page

This commit is contained in:
Jan Prochazka
2022-11-25 13:36:18 +01:00
parent 07b2a3e923
commit 70413b954b
6 changed files with 153 additions and 10 deletions

View File

@@ -4,18 +4,40 @@ import './utility/changeCurrentDbByTab';
import './commands/stdCommands';
import localStorageGarbageCollector from './utility/localStorageGarbageCollector';
import { handleOauthCallback } from './clientAuth';
import LoginPage from './LoginPage.svelte';
import NotLoggedPage from './NotLoggedPage.svelte';
const isOauthCallback = handleOauthCallback();
const params = new URLSearchParams(location.search);
const page = params.get('page');
localStorageGarbageCollector();
const app = isOauthCallback
? null
: new App({
target: document.body,
props: {},
});
function createApp() {
if (isOauthCallback) {
return null;
}
// const app = null;
switch (page) {
case 'login':
return new LoginPage({
target: document.body,
props: {},
});
case 'not-logged':
return new NotLoggedPage({
target: document.body,
props: {},
});
}
return new App({
target: document.body,
props: {},
});
}
const app = createApp();
export default app;