1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

Removed self-hosted restriction from Login with Device (#5441)

* Removed self-hosted restriction from Login with Device.

* Updated showPasswordless client-side flag to true for self-hosted.

* Linting

* Linting
This commit is contained in:
Todd Martin
2023-06-01 12:38:10 -04:00
committed by GitHub
parent cf63a5680c
commit 23bd5de37c
3 changed files with 7 additions and 14 deletions

View File

@@ -35,7 +35,6 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
onSuccessfulLoginNavigate: () => Promise<any>;
onSuccessfulLoginTwoFactorNavigate: () => Promise<any>;
onSuccessfulLoginForceResetNavigate: () => Promise<any>;
selfHosted = false;
showLoginWithDevice: boolean;
validatedEmail = false;
paramEmailSet = false;
@@ -73,7 +72,6 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
protected loginService: LoginService
) {
super(environmentService, i18nService, platformUtilsService);
this.selfHosted = platformUtilsService.isSelfHost();
}
get selfHostedDomain() {
@@ -295,9 +293,10 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
async getLoginWithDevice(email: string) {
try {
const deviceIdentifier = await this.appIdService.getAppId();
const res = await this.devicesApiService.getKnownDevice(email, deviceIdentifier);
//ensure the application is not self-hosted
this.showLoginWithDevice = res && !this.selfHosted;
this.showLoginWithDevice = await this.devicesApiService.getKnownDevice(
email,
deviceIdentifier
);
} catch (e) {
this.showLoginWithDevice = false;
}