File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 853
853
</ div >
854
854
< div class ="tab-pane " id ="tab-byo-ciam-content ">
855
855
< h2 > Sign in with your CIAM token</ h2 >
856
+ < div id ="firebase-token-status "> No CIAM token found. User not logged in.</ div >
856
857
< input type ="text " id ="byo-ciam-token "
857
858
class ="form-control " placeholder ="Enter CIAM token " />
858
859
< button class ="btn btn-block btn-primary "
Original file line number Diff line number Diff line change @@ -1521,16 +1521,16 @@ async function exchangeCIAMToken(token) {
1521
1521
function onExchangeToken ( event ) {
1522
1522
event . preventDefault ( ) ;
1523
1523
const byoCiamInput = document . getElementById ( 'byo-ciam-token' ) ;
1524
- const byoCiamResult = document . getElementById ( 'byo-ciam-result' ) ;
1525
-
1526
- byoCiamResult . textContent = 'Exchanging token...' ;
1524
+ const firebaseTokenStatus = document . getElementById ( 'firebase-token-status' ) ;
1527
1525
1526
+ firebaseTokenStatus . textContent = 'Exchanging token...' ;
1528
1527
exchangeCIAMToken ( byoCiamInput . value )
1529
1528
. then ( response => {
1530
- byoCiamResult . textContent = response ;
1529
+ firebaseTokenStatus . textContent = '✅ Firebase token is set: ' + response ;
1531
1530
console . log ( 'Token:' , response ) ;
1532
1531
} )
1533
1532
. catch ( error => {
1533
+ ( firebaseTokenStatus . textContent = 'Error exchanging token: ' ) , error ;
1534
1534
console . error ( 'Error exchanging token:' , error ) ;
1535
1535
} ) ;
1536
1536
}
@@ -2092,6 +2092,15 @@ function initApp() {
2092
2092
tenantConfig : tenantConfig
2093
2093
} ) ;
2094
2094
2095
+ const firebaseTokenStatus = document . getElementById ( 'firebase-token-status' ) ;
2096
+ setTimeout ( ( ) => {
2097
+ if ( regionalAuth . firebaseToken ) {
2098
+ firebaseTokenStatus . textContent = '✅ Firebase token is set: ' + regionalAuth . firebaseToken . token ;
2099
+ } else {
2100
+ firebaseTokenStatus . textContent = 'No CIAM token found. User not logged in.' ;
2101
+ }
2102
+ console . log ( "firebaseToken after delay: " , regionalAuth . firebaseToken ) ;
2103
+ } , 1000 ) ;
2095
2104
tempApp = initializeApp (
2096
2105
{
2097
2106
apiKey : config . apiKey ,
You can’t perform that action at this time.
0 commit comments