[go: nahoru, domu]

Skip to content

Commit

Permalink
Added ui for setting tenant-id (#6850)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhparijat committed Dec 7, 2022
1 parent 2857f04 commit 0df93b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/auth/demo/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@
</button>
</form>

<!-- Set Tenant -->
<div class="group">Set Tenant</div>
<form class="form form-bordered no-submit">
<input type="text" id="set-tenant"
class="form-control"
placeholder="Tenant" />
<button class="btn btn-block btn-primary"
id="set-tenant-btn">
Set Tenant
</button>
</form>

<!-- Sign up -->
<div class="group">Sign Up</div>
<form class="form form-bordered no-submit">
Expand Down
11 changes: 10 additions & 1 deletion packages/auth/demo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,14 @@ function onUseDeviceLanguage() {
$('#language-code').val(auth.languageCode);
alertSuccess('Using device language "' + auth.languageCode + '".');
}

/**
* Set tenant id for the firebase project.
*/
function onSetTenantIdClick(_event) {
const tenantId = $('#set-tenant').val();
auth.tenantId = tenantId === '' ? null : tenantId;
alertSuccess('Tenant Id : ' + auth.tenantId);
}
/**
* Changes the Auth state persistence to the specified one.
*/
Expand Down Expand Up @@ -2032,6 +2039,8 @@ function initApp() {
$('#enroll-mfa-totp-start').click(onStartEnrollWithTotpMultiFactor);
// Completes multi-factor enrollment with supplied OTP(One-Time Password).
$('#enroll-mfa-totp-finalize').click(onFinalizeEnrollWithTotpMultiFactor);
// Sets tenant for the current auth instance
$('#set-tenant-btn').click(onSetTenantIdClick);
}

$(initApp);

0 comments on commit 0df93b4

Please sign in to comment.