add redirecting

This commit is contained in:
Jesper Møller Jensen
2023-05-24 18:11:52 +12:00
parent d6c9eab61f
commit 8604fa123e
3 changed files with 7 additions and 2 deletions

View File

@@ -10,6 +10,6 @@
</head>
<body class="uui-font uui-text" style="margin: 0; padding: 0; overflow: hidden">
<umb-login></umb-login>
<umb-login return-url="https://www.umbraco.com"></umb-login>
</body>
</html>

View File

@@ -11,7 +11,7 @@ export class UmbAuthNewContext implements UmbAuthContext {
async login(data: LoginRequestModel) {
//TODO: call authUrl with data
const { error } = await UmbMockAPI.login(data, true);
const { error } = await UmbMockAPI.login(data, false);
//TODO Should the redirect be done here? or in the login element?

View File

@@ -69,6 +69,11 @@ export default class UmbLoginElement extends LitElement {
this._loginError = error || '';
this._loginState = error ? 'failed' : 'success';
if (error) return;
//TODO: Should redirecting be done here or in the context?
location.replace(this.returnUrl);
};
@state()