feat(core): Refactored plugin and request handling to use idpInterfaces

This commit is contained in:
2024-10-07 10:26:21 +02:00
parent 1bfdc67a0e
commit 03a8536297
25 changed files with 267 additions and 126 deletions
+9 -1
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';
view: 'welcome' | 'login' | 'register' | 'finishregistration' | 'account' | 'logout';
}>
public async init() {
@@ -44,6 +44,14 @@ export class IdpState {
})
});
this.domtools.router.on('/logout', async () => {
await this.idpClient.logout();
await this.mainStatePart.setState({
...this.mainStatePart.getState(),
view: 'logout',
})
});
this.domtools.router.on('/register', async () => {
await this.mainStatePart.setState({
...this.mainStatePart.getState(),