cleanup
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { LoginRequestModel, IUmbAuthContext } from './types';
|
||||
import { LoginRequestModel, IUmbAuthContext, LoginResponse } from './types';
|
||||
|
||||
export class UmbAuthLegacyContext implements IUmbAuthContext {
|
||||
readonly #AUTH_URL = '/umbraco/backoffice/umbracoapi/authentication/postlogin';
|
||||
|
||||
login(data: LoginRequestModel): Promise<{ error?: string | undefined }> {
|
||||
login(data: LoginRequestModel): Promise<LoginResponse> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,12 +67,12 @@ export default class UmbLoginElement extends LitElement {
|
||||
|
||||
this._loginState = 'waiting';
|
||||
|
||||
const { error } = await this.#authContext.login({ username, password, persist });
|
||||
const response = await this.#authContext.login({ username, password, persist });
|
||||
|
||||
this._loginError = error || '';
|
||||
this._loginState = error ? 'failed' : 'success';
|
||||
this._loginError = response.error || '';
|
||||
this._loginState = response.error ? 'failed' : 'success';
|
||||
|
||||
if (error) return;
|
||||
if (response.error) return;
|
||||
|
||||
location.href = this.returnUrl;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user