@@ -1305,6 +1305,7 @@ function onRefreshToken() {
13051305function onSignOut ( ) {
13061306 setLastUser ( auth . currentUser ) ;
13071307 auth . signOut ( ) . then ( signOut , onAuthError ) ;
1308+ regionalAuth . signOut ( ) ;
13081309}
13091310
13101311/**
@@ -1520,16 +1521,17 @@ async function exchangeCIAMToken(token) {
15201521function onExchangeToken ( event ) {
15211522 event . preventDefault ( ) ;
15221523 const byoCiamInput = document . getElementById ( 'byo-ciam-token' ) ;
1523- const byoCiamResult = document . getElementById ( 'byo-ciam-result ' ) ;
1524+ const firebaseTokenStatus = document . getElementById ( 'firebase-token-status ' ) ;
15241525
1525- byoCiamResult . textContent = 'Exchanging token...' ;
1526+ firebaseTokenStatus . textContent = 'Exchanging token...' ;
15261527
15271528 exchangeCIAMToken ( byoCiamInput . value )
15281529 . then ( response => {
1529- byoCiamResult . textContent = response ;
1530+ firebaseTokenStatus . textContent = '✅ Firebase token is set: ' + response ;
15301531 console . log ( 'Token:' , response ) ;
15311532 } )
15321533 . catch ( error => {
1534+ ( firebaseTokenStatus . textContent = 'Error exchanging token: ' ) , error ;
15331535 console . error ( 'Error exchanging token:' , error ) ;
15341536 } ) ;
15351537}
@@ -2091,6 +2093,18 @@ function initApp() {
20912093 tenantConfig : tenantConfig
20922094 } ) ;
20932095
2096+ const firebaseTokenStatus = document . getElementById ( 'firebase-token-status' ) ;
2097+ setTimeout ( ( ) => {
2098+ if ( regionalAuth . firebaseToken ) {
2099+ firebaseTokenStatus . textContent =
2100+ '✅ Firebase token is set: ' + regionalAuth . firebaseToken . token ;
2101+ } else {
2102+ firebaseTokenStatus . textContent =
2103+ 'No CIAM token found. User not logged in.' ;
2104+ }
2105+ console . log ( 'firebaseToken after delay: ' , regionalAuth . firebaseToken ) ;
2106+ } , 1000 ) ;
2107+
20942108 tempApp = initializeApp (
20952109 {
20962110 apiKey : config . apiKey ,
0 commit comments