@lumiapassport/ui-kit 1.16.3 → 1.16.4
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +23 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5638,7 +5638,7 @@ function Header() {
|
|
|
5638
5638
|
// package.json
|
|
5639
5639
|
var package_default = {
|
|
5640
5640
|
name: "@lumiapassport/ui-kit",
|
|
5641
|
-
version: "1.16.
|
|
5641
|
+
version: "1.16.4",
|
|
5642
5642
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
5643
5643
|
type: "module",
|
|
5644
5644
|
main: "./dist/index.cjs",
|
|
@@ -6917,17 +6917,29 @@ function Social(props) {
|
|
|
6917
6917
|
const iframeManager = getIframeManager2();
|
|
6918
6918
|
const finalizeSocialLogin = async (rawLoginResponse, providerKey, userData) => {
|
|
6919
6919
|
let loginResponse2 = await normalizeSocialLoginResponse(rawLoginResponse, providerKey, userData);
|
|
6920
|
-
const
|
|
6921
|
-
|
|
6920
|
+
const existingAccessToken = jwtTokenManager2.getAccessToken();
|
|
6921
|
+
const existingRefreshToken = jwtTokenManager2.getRefreshToken();
|
|
6922
|
+
if (existingAccessToken && existingRefreshToken && !loginResponse2.accessToken) {
|
|
6923
|
+
console.log("[AuthModal] Using tokens already stored by iframe-manager");
|
|
6924
|
+
loginResponse2 = {
|
|
6925
|
+
...loginResponse2,
|
|
6926
|
+
accessToken: existingAccessToken,
|
|
6927
|
+
refreshToken: existingRefreshToken
|
|
6928
|
+
};
|
|
6929
|
+
}
|
|
6922
6930
|
if (!loginResponse2.accessToken || !loginResponse2.refreshToken) {
|
|
6923
|
-
const
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
+
const tokenExchangeConfig = authConfig?.tokenExchange || provider?.tokenExchange;
|
|
6932
|
+
loginResponse2 = await enrichLoginResponseWithTokens(loginResponse2, providerKey, tokenExchangeConfig);
|
|
6933
|
+
if (!loginResponse2.accessToken || !loginResponse2.refreshToken) {
|
|
6934
|
+
const refreshTokens = await fetchTokensFromRefreshEndpoint();
|
|
6935
|
+
if (refreshTokens) {
|
|
6936
|
+
loginResponse2 = {
|
|
6937
|
+
...loginResponse2,
|
|
6938
|
+
accessToken: refreshTokens.accessToken,
|
|
6939
|
+
refreshToken: refreshTokens.refreshToken,
|
|
6940
|
+
expiresIn: refreshTokens.expiresIn
|
|
6941
|
+
};
|
|
6942
|
+
}
|
|
6931
6943
|
}
|
|
6932
6944
|
}
|
|
6933
6945
|
if (!loginResponse2) {
|