@@ -29,6 +29,7 @@ import UpdateTenantRequest = auth.UpdateTenantRequest;
29
29
/** The corresponding server side representation of a TenantOptions object. */
30
30
export interface TenantOptionsServerRequest extends EmailSignInConfigServerRequest {
31
31
displayName ?: string ;
32
+ enableAnonymousUser ?: boolean ;
32
33
mfaConfig ?: MultiFactorAuthServerConfig ;
33
34
testPhoneNumbers ?: { [ key : string ] : string } ;
34
35
}
@@ -39,6 +40,7 @@ export interface TenantServerResponse {
39
40
displayName ?: string ;
40
41
allowPasswordSignup ?: boolean ;
41
42
enableEmailLinkSignin ?: boolean ;
43
+ enableAnonymousUser ?: boolean ;
42
44
mfaConfig ?: MultiFactorAuthServerConfig ;
43
45
testPhoneNumbers ?: { [ key : string ] : string } ;
44
46
}
@@ -50,6 +52,7 @@ export class Tenant implements TenantInterface {
50
52
public readonly tenantId : string ;
51
53
public readonly displayName ?: string ;
52
54
public readonly emailSignInConfig ?: EmailSignInConfig ;
55
+ public readonly anonymousSignInEnabled : boolean ;
53
56
public readonly multiFactorConfig ?: MultiFactorAuthConfig ;
54
57
public readonly testPhoneNumbers ?: { [ phoneNumber : string ] : string } ;
55
58
@@ -70,6 +73,9 @@ export class Tenant implements TenantInterface {
70
73
if ( typeof tenantOptions . displayName !== 'undefined' ) {
71
74
request . displayName = tenantOptions . displayName ;
72
75
}
76
+ if ( typeof tenantOptions . anonymousSignInEnabled !== 'undefined' ) {
77
+ request . enableAnonymousUser = tenantOptions . anonymousSignInEnabled ;
78
+ }
73
79
if ( typeof tenantOptions . multiFactorConfig !== 'undefined' ) {
74
80
request . mfaConfig = MultiFactorAuthConfig . buildServerRequest ( tenantOptions . multiFactorConfig ) ;
75
81
}
@@ -105,6 +111,7 @@ export class Tenant implements TenantInterface {
105
111
const validKeys = {
106
112
displayName : true ,
107
113
emailSignInConfig : true ,
114
+ anonymousSignInEnabled : true ,
108
115
multiFactorConfig : true ,
109
116
testPhoneNumbers : true ,
110
117
} ;
@@ -179,6 +186,7 @@ export class Tenant implements TenantInterface {
179
186
allowPasswordSignup : false ,
180
187
} ) ;
181
188
}
189
+ this . anonymousSignInEnabled = ! ! response . enableAnonymousUser ;
182
190
if ( typeof response . mfaConfig !== 'undefined' ) {
183
191
this . multiFactorConfig = new MultiFactorAuthConfig ( response . mfaConfig ) ;
184
192
}
@@ -193,6 +201,7 @@ export class Tenant implements TenantInterface {
193
201
tenantId : this . tenantId ,
194
202
displayName : this . displayName ,
195
203
emailSignInConfig : this . emailSignInConfig ?. toJSON ( ) ,
204
+ anonymousSignInEnabled : this . anonymousSignInEnabled ,
196
205
multiFactorConfig : this . multiFactorConfig ?. toJSON ( ) ,
197
206
testPhoneNumbers : this . testPhoneNumbers ,
198
207
} ;
0 commit comments