1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 10:33:57 +00:00

[SSO] Set password auto enroll update (#472)

* [SSO/Auto Enroll] Set Password enrolls new user

* Fixed typo

* Linter updates

* Cleanup // Constructor for SetPasswordRequest
This commit is contained in:
Vincent Salucci
2021-09-03 14:49:03 -05:00
committed by GitHub
parent 6c9485596c
commit ef743ea8ca
4 changed files with 83 additions and 21 deletions

View File

@@ -166,6 +166,15 @@ export class UserService implements UserServiceAbstraction {
return new Organization(organizations[id]);
}
async getOrganizationByIdentifier(identifier: string): Promise<Organization> {
const organizations = await this.getAllOrganizations();
if (organizations == null || organizations.length === 0) {
return null;
}
return organizations.find(o => o.identifier === identifier);
}
async getAllOrganizations(): Promise<Organization[]> {
const userId = await this.getUserId();
const organizations = await this.storageService.get<{ [id: string]: OrganizationData; }>(