fix(core): Added logging for user email login process and fixed client URL parsing
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { IdpState } from '../idp.state.js';
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as elements from '../elements/index.js';
|
||||
|
||||
import {
|
||||
customElement,
|
||||
@@ -32,21 +34,20 @@ export class IdpViewcontainer extends DeesElement {
|
||||
min-width: 100vh;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
`,
|
||||
`,
|
||||
];
|
||||
|
||||
public render(): TemplateResult {
|
||||
return html`
|
||||
<style></style>
|
||||
<div class="viewContainer">
|
||||
|
||||
</div>
|
||||
<div class="viewContainer"></div>
|
||||
`;
|
||||
}
|
||||
|
||||
public currentElement: plugins.deesElement.DeesElement;
|
||||
public async loadElement(viewElement: typeof plugins.deesElement.DeesElement) {
|
||||
const idpState = await IdpState.getSingletonInstance();
|
||||
|
||||
// Wait until the viewContainer itself is rendered
|
||||
await this.updateComplete;
|
||||
|
||||
@@ -74,4 +75,24 @@ export class IdpViewcontainer extends DeesElement {
|
||||
// Set the new element as the current element
|
||||
this.currentElement = newElement;
|
||||
}
|
||||
|
||||
public async firstUpdated() {
|
||||
const idpState = await IdpState.getSingletonInstance();
|
||||
idpState.mainStatePart
|
||||
.select((stateArg) => stateArg.view)
|
||||
.subscribe(async (viewArg) => {
|
||||
switch (viewArg) {
|
||||
case 'welcome':
|
||||
await this.loadElement(elements.IdpWelcome);
|
||||
break;
|
||||
case 'login':
|
||||
console.log('now on /login');
|
||||
await this.loadElement(elements.IdpLogincontainer);
|
||||
break;
|
||||
case 'register':
|
||||
await this.loadElement(elements.IdpRegistrationPrompt);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user