Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/auth/tenant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { AuthClientErrorCode, FirebaseAuthError } from '../utils/error';
import {
EmailSignInConfig, EmailSignInConfigServerRequest, MultiFactorAuthServerConfig,
MultiFactorConfig, validateTestPhoneNumbers, EmailSignInProviderConfig,
MultiFactorAuthConfig, SmsRegionConfig, SmsRegionsAuthConfig, RecaptchaAuthConfig, RecaptchaConfig,
MultiFactorAuthConfig, SmsRegionConfig, SmsRegionsAuthConfig, RecaptchaAuthConfig, RecaptchaConfig,
RecaptchaAuthServerConfig, PasswordPolicyConfig,
PasswordPolicyAuthConfig, PasswordPolicyAuthServerConfig, EmailPrivacyConfig, EmailPrivacyAuthConfig,
} from './auth-config';
Expand Down Expand Up @@ -61,7 +61,7 @@ export interface UpdateTenantRequest {
* The SMS configuration to update on the project.
*/
smsRegionConfig?: SmsRegionConfig;

/**
* The reCAPTCHA configuration to update on the tenant.
* By enabling reCAPTCHA Enterprise integration, you are
Expand Down Expand Up @@ -103,6 +103,7 @@ export interface TenantServerResponse {
displayName?: string;
allowPasswordSignup?: boolean;
enableEmailLinkSignin?: boolean;
disableAuth?: boolean;
enableAnonymousUser?: boolean;
mfaConfig?: MultiFactorAuthServerConfig;
testPhoneNumbers?: {[key: string]: string};
Expand Down Expand Up @@ -144,6 +145,13 @@ export class Tenant {
*/
public readonly displayName?: string;

/**
* Whether authentication is disabled for the tenant.
* If true, the users under the disabled tenant are not allowed to sign-in.
* Admins of the disabled tenant are not able to manage its users.
*/
public readonly disableAuth: boolean

public readonly anonymousSignInEnabled: boolean;

/**
Expand Down Expand Up @@ -344,6 +352,7 @@ export class Tenant {
allowPasswordSignup: false,
});
}
this.disableAuth = !!response.disableAuth;
this.anonymousSignInEnabled = !!response.enableAnonymousUser;
if (typeof response.mfaConfig !== 'undefined') {
this.multiFactorConfig_ = new MultiFactorAuthConfig(response.mfaConfig);
Expand Down Expand Up @@ -397,6 +406,7 @@ export class Tenant {
displayName: this.displayName,
emailSignInConfig: this.emailSignInConfig_?.toJSON(),
multiFactorConfig: this.multiFactorConfig_?.toJSON(),
disableAuth: this.disableAuth,
anonymousSignInEnabled: this.anonymousSignInEnabled,
testPhoneNumbers: this.testPhoneNumbers,
smsRegionConfig: deepCopy(this.smsRegionConfig),
Expand Down
Loading