add redirecting
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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?
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user