@@ -29,6 +29,7 @@ import UpdateTenantRequest = auth.UpdateTenantRequest;
2929/** The corresponding server side representation of a TenantOptions object. */
3030export interface TenantOptionsServerRequest extends EmailSignInConfigServerRequest {
3131 displayName ?: string ;
32+ enableAnonymousUser ?: boolean ;
3233 mfaConfig ?: MultiFactorAuthServerConfig ;
3334 testPhoneNumbers ?: { [ key : string ] : string } ;
3435}
@@ -39,6 +40,7 @@ export interface TenantServerResponse {
3940 displayName ?: string ;
4041 allowPasswordSignup ?: boolean ;
4142 enableEmailLinkSignin ?: boolean ;
43+ enableAnonymousUser ?: boolean ;
4244 mfaConfig ?: MultiFactorAuthServerConfig ;
4345 testPhoneNumbers ?: { [ key : string ] : string } ;
4446}
@@ -50,6 +52,7 @@ export class Tenant implements TenantInterface {
5052 public readonly tenantId : string ;
5153 public readonly displayName ?: string ;
5254 public readonly emailSignInConfig ?: EmailSignInConfig ;
55+ public readonly anonymousSignInEnabled : boolean ;
5356 public readonly multiFactorConfig ?: MultiFactorAuthConfig ;
5457 public readonly testPhoneNumbers ?: { [ phoneNumber : string ] : string } ;
5558
@@ -70,6 +73,9 @@ export class Tenant implements TenantInterface {
7073 if ( typeof tenantOptions . displayName !== 'undefined' ) {
7174 request . displayName = tenantOptions . displayName ;
7275 }
76+ if ( typeof tenantOptions . anonymousSignInEnabled !== 'undefined' ) {
77+ request . enableAnonymousUser = tenantOptions . anonymousSignInEnabled ;
78+ }
7379 if ( typeof tenantOptions . multiFactorConfig !== 'undefined' ) {
7480 request . mfaConfig = MultiFactorAuthConfig . buildServerRequest ( tenantOptions . multiFactorConfig ) ;
7581 }
@@ -105,6 +111,7 @@ export class Tenant implements TenantInterface {
105111 const validKeys = {
106112 displayName : true ,
107113 emailSignInConfig : true ,
114+ anonymousSignInEnabled : true ,
108115 multiFactorConfig : true ,
109116 testPhoneNumbers : true ,
110117 } ;
@@ -179,6 +186,7 @@ export class Tenant implements TenantInterface {
179186 allowPasswordSignup : false ,
180187 } ) ;
181188 }
189+ this . anonymousSignInEnabled = ! ! response . enableAnonymousUser ;
182190 if ( typeof response . mfaConfig !== 'undefined' ) {
183191 this . multiFactorConfig = new MultiFactorAuthConfig ( response . mfaConfig ) ;
184192 }
@@ -193,6 +201,7 @@ export class Tenant implements TenantInterface {
193201 tenantId : this . tenantId ,
194202 displayName : this . displayName ,
195203 emailSignInConfig : this . emailSignInConfig ?. toJSON ( ) ,
204+ anonymousSignInEnabled : this . anonymousSignInEnabled ,
196205 multiFactorConfig : this . multiFactorConfig ?. toJSON ( ) ,
197206 testPhoneNumbers : this . testPhoneNumbers ,
198207 } ;
0 commit comments