mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[PM-5364] Create SSO Login Service and add state ownership (#7485)
* create sso service * rename sso service to sso-login service * rename service * add references to sso login service and update state calls * fix browser * fix desktop * return promises * remove sso state from account and global objects * more descriptive org sso identifier method names * fix sso tests * fix tests
This commit is contained in:
@@ -377,25 +377,6 @@ export class AccountDecryptionOptions {
|
||||
}
|
||||
}
|
||||
|
||||
export class LoginState {
|
||||
ssoOrganizationIdentifier?: string;
|
||||
|
||||
constructor(init?: Partial<LoginState>) {
|
||||
if (init) {
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
static fromJSON(obj: Jsonify<LoginState>): LoginState {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const loginState = Object.assign(new LoginState(), obj);
|
||||
return loginState;
|
||||
}
|
||||
}
|
||||
|
||||
export class Account {
|
||||
data?: AccountData = new AccountData();
|
||||
keys?: AccountKeys = new AccountKeys();
|
||||
@@ -403,7 +384,6 @@ export class Account {
|
||||
settings?: AccountSettings = new AccountSettings();
|
||||
tokens?: AccountTokens = new AccountTokens();
|
||||
decryptionOptions?: AccountDecryptionOptions = new AccountDecryptionOptions();
|
||||
loginState?: LoginState = new LoginState();
|
||||
adminAuthRequest?: Jsonify<AdminAuthRequestStorable> = null;
|
||||
|
||||
constructor(init: Partial<Account>) {
|
||||
@@ -432,10 +412,6 @@ export class Account {
|
||||
...new AccountDecryptionOptions(),
|
||||
...init?.decryptionOptions,
|
||||
},
|
||||
loginState: {
|
||||
...new LoginState(),
|
||||
...init?.loginState,
|
||||
},
|
||||
adminAuthRequest: init?.adminAuthRequest,
|
||||
});
|
||||
}
|
||||
@@ -452,7 +428,6 @@ export class Account {
|
||||
settings: AccountSettings.fromJSON(json?.settings),
|
||||
tokens: AccountTokens.fromJSON(json?.tokens),
|
||||
decryptionOptions: AccountDecryptionOptions.fromJSON(json?.decryptionOptions),
|
||||
loginState: LoginState.fromJSON(json?.loginState),
|
||||
adminAuthRequest: AdminAuthRequestStorable.fromJSON(json?.adminAuthRequest),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user