feat(app): wire dashboard administration flows

This commit is contained in:
2026-05-07 15:35:37 +00:00
parent e9eb9b4172
commit 91f06ccae1
91 changed files with 4087 additions and 5863 deletions
+20 -4
View File
@@ -19,7 +19,7 @@ export class IdpState {
public idpClient = new plugins.idpClient.IdpClient(this.receptionUrl);
public domtools: domtools.DomTools;
public mainStatePart: plugins.deesDomtools.plugins.smartstate.StatePart<'main', {
view: 'welcome' | 'login' | 'register' | 'finishregistration' | 'account' | 'logout';
view: 'welcome' | 'login' | 'register' | 'finishregistration' | 'dash' | 'logout';
}>
public async init() {
@@ -38,6 +38,12 @@ export class IdpState {
});
this.domtools.router.on('/login', async () => {
const isOauthLogin = new URL(window.location.href).searchParams.get('oauth') === 'true';
if (!isOauthLogin && await this.idpClient.determineLoginStatus(false)) {
this.domtools.router.pushUrl('/dash/overview');
return;
}
await this.mainStatePart.setState({
...this.mainStatePart.getState(),
view: 'login',
@@ -53,6 +59,11 @@ export class IdpState {
});
this.domtools.router.on('/register', async () => {
if (await this.idpClient.determineLoginStatus(false)) {
this.domtools.router.pushUrl('/dash/overview');
return;
}
await this.mainStatePart.setState({
...this.mainStatePart.getState(),
view: 'register',
@@ -66,13 +77,18 @@ export class IdpState {
})
});
this.domtools.router.on('/account{/*path}', async () => {
this.domtools.router.on('/dash{/*path}', async () => {
if (!await this.idpClient.determineLoginStatus(false)) {
this.domtools.router.pushUrl('/login');
return;
}
await this.mainStatePart.setState({
...this.mainStatePart.getState(),
view: 'account',
view: 'dash',
})
});
this.domtools.router._handleRouteState();
}
}
}