Skip to content

Commit b75a3fe

Browse files
authored
Merge 5f0fdfd into 2857f04
2 parents 2857f04 + 5f0fdfd commit b75a3fe

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

packages/auth/demo/public/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@
229229
</button>
230230
</form>
231231

232+
<!-- Set Tenant -->
233+
<div class="group">Set Tenant</div>
234+
<form class="form form-bordered no-submit">
235+
<input type="text" id="set-tenant"
236+
class="form-control"
237+
placeholder="Tenant" />
238+
<button class="btn btn-block btn-primary"
239+
id="set-tenant-btn">
240+
Set Tenant
241+
</button>
242+
</form>
243+
232244
<!-- Sign up -->
233245
<div class="group">Sign Up</div>
234246
<form class="form form-bordered no-submit">

packages/auth/demo/src/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,14 @@ function onUseDeviceLanguage() {
314314
$('#language-code').val(auth.languageCode);
315315
alertSuccess('Using device language "' + auth.languageCode + '".');
316316
}
317-
317+
/**
318+
* Set tenant id for the firebase project.
319+
*/
320+
function onSetTenantIdClick(_event) {
321+
const tenantId = $('#set-tenant').val();
322+
auth.tenantId = tenantId === '' ? null : tenantId;
323+
alertSuccess('Tenant Id : ' + auth.tenantId);
324+
}
318325
/**
319326
* Changes the Auth state persistence to the specified one.
320327
*/
@@ -2032,6 +2039,8 @@ function initApp() {
20322039
$('#enroll-mfa-totp-start').click(onStartEnrollWithTotpMultiFactor);
20332040
// Completes multi-factor enrollment with supplied OTP(One-Time Password).
20342041
$('#enroll-mfa-totp-finalize').click(onFinalizeEnrollWithTotpMultiFactor);
2042+
// Sets tenant for the current auth instance
2043+
$('#set-tenant-btn').click(onSetTenantIdClick);
20352044
}
20362045

20372046
$(initApp);

0 commit comments

Comments
 (0)