@@ -1305,6 +1305,7 @@ function onRefreshToken() {
1305
1305
function onSignOut ( ) {
1306
1306
setLastUser ( auth . currentUser ) ;
1307
1307
auth . signOut ( ) . then ( signOut , onAuthError ) ;
1308
+ regionalAuth . signOut ( ) ;
1308
1309
}
1309
1310
1310
1311
/**
@@ -1520,16 +1521,17 @@ async function exchangeCIAMToken(token) {
1520
1521
function onExchangeToken ( event ) {
1521
1522
event . preventDefault ( ) ;
1522
1523
const byoCiamInput = document . getElementById ( 'byo-ciam-token' ) ;
1523
- const byoCiamResult = document . getElementById ( 'byo-ciam-result ' ) ;
1524
+ const firebaseTokenStatus = document . getElementById ( 'firebase-token-status ' ) ;
1524
1525
1525
- byoCiamResult . textContent = 'Exchanging token...' ;
1526
+ firebaseTokenStatus . textContent = 'Exchanging token...' ;
1526
1527
1527
1528
exchangeCIAMToken ( byoCiamInput . value )
1528
1529
. then ( response => {
1529
- byoCiamResult . textContent = response ;
1530
+ firebaseTokenStatus . textContent = '✅ Firebase token is set: ' + response ;
1530
1531
console . log ( 'Token:' , response ) ;
1531
1532
} )
1532
1533
. catch ( error => {
1534
+ ( firebaseTokenStatus . textContent = 'Error exchanging token: ' ) , error ;
1533
1535
console . error ( 'Error exchanging token:' , error ) ;
1534
1536
} ) ;
1535
1537
}
@@ -2091,6 +2093,18 @@ function initApp() {
2091
2093
tenantConfig : tenantConfig
2092
2094
} ) ;
2093
2095
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
+
2094
2108
tempApp = initializeApp (
2095
2109
{
2096
2110
apiKey : config . apiKey ,
0 commit comments