sunuid-sdk 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sunuid-sdk.esm.js
CHANGED
|
@@ -854,9 +854,26 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
854
854
|
}, {
|
|
855
855
|
key: "handleQRScanSuccess",
|
|
856
856
|
value: function handleQRScanSuccess(data) {
|
|
857
|
-
console.log('✅ QR Scan Success:', data);
|
|
858
|
-
|
|
859
|
-
|
|
857
|
+
console.log('✅ QR Scan Success reçu:', data);
|
|
858
|
+
try {
|
|
859
|
+
// Traiter l'authentification comme un callback
|
|
860
|
+
this.processAuthentication(data);
|
|
861
|
+
|
|
862
|
+
// Afficher un message de succès
|
|
863
|
+
this.showSuccessMessage(data);
|
|
864
|
+
|
|
865
|
+
// Appeler le callback de succès (pour compatibilité)
|
|
866
|
+
if (this.config.onSuccess) {
|
|
867
|
+
this.config.onSuccess(data);
|
|
868
|
+
}
|
|
869
|
+
console.log('✅ Authentification WebSocket traitée avec succès');
|
|
870
|
+
} catch (error) {
|
|
871
|
+
console.error('❌ Erreur lors du traitement WebSocket:', error);
|
|
872
|
+
|
|
873
|
+
// Appeler le callback d'erreur
|
|
874
|
+
if (this.config.onAuthenticationError) {
|
|
875
|
+
this.config.onAuthenticationError(error, data);
|
|
876
|
+
}
|
|
860
877
|
}
|
|
861
878
|
}
|
|
862
879
|
|
|
@@ -2576,6 +2593,37 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
2576
2593
|
console.log('✅ Loader affiché avec succès');
|
|
2577
2594
|
}
|
|
2578
2595
|
|
|
2596
|
+
/**
|
|
2597
|
+
* Afficher un message de succès après authentification
|
|
2598
|
+
*/
|
|
2599
|
+
}, {
|
|
2600
|
+
key: "showSuccessMessage",
|
|
2601
|
+
value: function showSuccessMessage(data) {
|
|
2602
|
+
console.log('✅ Affichage du message de succès');
|
|
2603
|
+
|
|
2604
|
+
// Chercher le conteneur QR dans différents IDs possibles
|
|
2605
|
+
var containerIds = ['qr-area', 'qr-container', 'sunuid-qr-container'];
|
|
2606
|
+
var container = null;
|
|
2607
|
+
for (var _i3 = 0, _containerIds2 = containerIds; _i3 < _containerIds2.length; _i3++) {
|
|
2608
|
+
var id = _containerIds2[_i3];
|
|
2609
|
+
container = document.getElementById(id);
|
|
2610
|
+
if (container) break;
|
|
2611
|
+
}
|
|
2612
|
+
if (!container) {
|
|
2613
|
+
console.warn('⚠️ Conteneur QR non trouvé pour afficher le message de succès');
|
|
2614
|
+
return;
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
// Extraire les informations utilisateur
|
|
2618
|
+
var userInfo = data.user_info || {};
|
|
2619
|
+
var userName = userInfo.name || userInfo.username || 'Utilisateur';
|
|
2620
|
+
var userEmail = userInfo.email || '';
|
|
2621
|
+
|
|
2622
|
+
// Remplacer le contenu par un message de succès
|
|
2623
|
+
container.innerHTML = "\n <div style=\"\n text-align: center;\n padding: 40px 20px;\n background: #d4edda;\n border: 2px solid #28a745;\n border-radius: 10px;\n color: #155724;\n font-family: Arial, sans-serif;\n \">\n <div style=\"\n width: 60px;\n height: 60px;\n background: #28a745;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 auto 20px auto;\n font-size: 30px;\n color: white;\n \">\u2705</div>\n <h3 style=\"margin: 0 0 10px 0; color: #155724;\">\uD83C\uDF89 Authentification r\xE9ussie !</h3>\n <p style=\"margin: 0 0 15px 0; font-size: 16px; font-weight: bold;\">\n Bienvenue, ".concat(userName, " !\n </p>\n ").concat(userEmail ? "<p style=\"margin: 0 0 15px 0; font-size: 14px; color: #6c757d;\">".concat(userEmail, "</p>") : '', "\n <p style=\"margin: 0; font-size: 14px;\">\n Votre identit\xE9 a \xE9t\xE9 v\xE9rifi\xE9e avec succ\xE8s.\n </p>\n <div style=\"margin-top: 20px; font-size: 12px; color: #6c757d;\">\n \uD83D\uDD04 Redirection en cours...\n </div>\n </div>\n ");
|
|
2624
|
+
console.log('✅ Message de succès affiché');
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2579
2627
|
/**
|
|
2580
2628
|
* Gérer le callback SunuID
|
|
2581
2629
|
*/
|