FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: expose disableAuth property on Tenant by mnahkies · Pull Request #2909 · firebase/firebase-admin-node · GitHub

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
14 changes: 12 additions & 2 deletions src/auth/tenant.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL