Skip to content

Commit 5c14777

Browse files
committed
Demo app improvements
1 parent a1dcf48 commit 5c14777

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/auth/demo/public/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,15 +853,26 @@
853853
</div>
854854
<div class="tab-pane" id="tab-byo-ciam-content">
855855
<h2>Sign in with your CIAM token</h2>
856+
857+
<!-- Initialize Regional Auth -->
858+
<div class="group">Initialize Regional Auth</div>
856859
<div class="form-group">
857860
<label for="tenant-id-input">Tenant ID</label>
858861
<input type="text" class="form-control" id="tenant-id-input" placeholder="Enter Tenant ID">
859862
</div>
860863
<button class="btn btn-primary" id="initialize-regional-auth-btn">Initialize Regional Auth</button>
864+
<div id="regional-auth-status"></div>
861865
<hr>
866+
867+
<!-- Set Token Refresh Handler -->
868+
<div class="group">Set Token Refresh Handler</div>
862869
<button class="btn btn-success" id="set-successful-handler-btn">Set Token Refresh Handler (Success)</button>
863870
<button class="btn btn-danger" id="set-failure-handler-btn">Set Token Refresh Handler (Failure)</button>
871+
<div id="token-handler-status"></div>
864872
<hr>
873+
874+
<!-- Exchange Token -->
875+
<div class="group">Exchange Token</div>
865876
<div id="firebase-token-status">No CIAM token found. User not logged in.</div>
866877
<input type="text" id="idp-config-id" class="form-control" placeholder="IDP Config ID" />
867878
<input type="text" id="byo-ciam-token"

packages/auth/demo/src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,8 @@ function onInitializeRegionalAuthClick() {
16201620
popupRedirectResolver: browserPopupRedirectResolver,
16211621
tenantConfig: tenantConfig
16221622
});
1623+
$('#regional-auth-status').text('✅ regionalAuth is initialized');
1624+
$('#token-handler-status').text('Token refresh handler is not set.');
16231625
const handlerType = localStorage.getItem('tokenRefreshHandlerType');
16241626
if (handlerType === 'success') {
16251627
onSetSuccessfulHandlerClick();
@@ -1688,6 +1690,7 @@ function onSetSuccessfulHandlerClick() {
16881690
const tokenRefreshHandler = new TokenRefreshHandlerImpl();
16891691
regionalAuth.setTokenRefreshHandler(tokenRefreshHandler);
16901692
localStorage.setItem('tokenRefreshHandlerType', 'success');
1693+
$('#token-handler-status').text('✅ Token refresh handler is set to success.');
16911694
}
16921695

16931696
function onSetFailureHandlerClick() {
@@ -1703,6 +1706,7 @@ function onSetFailureHandlerClick() {
17031706
const tokenRefreshHandler = new TokenRefreshHandlerFailureImpl();
17041707
regionalAuth.setTokenRefreshHandler(tokenRefreshHandler);
17051708
localStorage.setItem('tokenRefreshHandlerType', 'failure');
1709+
$('#token-handler-status').text('✅ Token refresh handler is set to failure.');
17061710
}
17071711

17081712
/**

0 commit comments

Comments
 (0)