@pelcro/react-pelcro-js 3.26.0-beta.78 → 3.26.0-beta.79
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/index.cjs.js +102 -11
- package/dist/index.esm.js +102 -11
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3541,7 +3541,9 @@ var messages$17 = {
|
|
|
3541
3541
|
}
|
|
3542
3542
|
};
|
|
3543
3543
|
var errors$h = {
|
|
3544
|
-
|
|
3544
|
+
facebookNoEmail: "Your Facebook account doesn't have an email address. Please use a different login method or add an email to your Facebook account.",
|
|
3545
|
+
googleNoEmail: "Your Google account doesn't have an email address. Please use a different login method or add an email to your Google account.",
|
|
3546
|
+
auth0NoEmail: "Your Auth0 account doesn't have an email address. Please use a different login method or add an email to your Auth0 account."
|
|
3545
3547
|
};
|
|
3546
3548
|
var login_en = {
|
|
3547
3549
|
labels: labels$14,
|
|
@@ -3602,7 +3604,9 @@ var messages$15 = {
|
|
|
3602
3604
|
}
|
|
3603
3605
|
};
|
|
3604
3606
|
var errors$g = {
|
|
3605
|
-
|
|
3607
|
+
facebookNoEmail: "Your Facebook account doesn't have an email address. Please use a different login method or add an email to your Facebook account.",
|
|
3608
|
+
googleNoEmail: "Your Google account doesn't have an email address. Please use a different login method or add an email to your Google account.",
|
|
3609
|
+
auth0NoEmail: "Your Auth0 account doesn't have an email address. Please use a different login method or add an email to your Auth0 account."
|
|
3606
3610
|
};
|
|
3607
3611
|
var gift$3 = {
|
|
3608
3612
|
titles: {
|
|
@@ -4503,7 +4507,9 @@ var messages$Q = {
|
|
|
4503
4507
|
}
|
|
4504
4508
|
};
|
|
4505
4509
|
var errors$c = {
|
|
4506
|
-
|
|
4510
|
+
facebookNoEmail: "Votre compte Facebook n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Facebook.",
|
|
4511
|
+
googleNoEmail: "Votre compte Google n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Google.",
|
|
4512
|
+
auth0NoEmail: "Votre compte Auth0 n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Auth0."
|
|
4507
4513
|
};
|
|
4508
4514
|
var login_fr = {
|
|
4509
4515
|
labels: labels$O,
|
|
@@ -4564,7 +4570,9 @@ var messages$O = {
|
|
|
4564
4570
|
}
|
|
4565
4571
|
};
|
|
4566
4572
|
var errors$b = {
|
|
4567
|
-
|
|
4573
|
+
facebookNoEmail: "Votre compte Facebook n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Facebook.",
|
|
4574
|
+
googleNoEmail: "Votre compte Google n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Google.",
|
|
4575
|
+
auth0NoEmail: "Votre compte Auth0 n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Auth0."
|
|
4568
4576
|
};
|
|
4569
4577
|
var gift$2 = {
|
|
4570
4578
|
titles: {
|
|
@@ -5455,7 +5463,9 @@ var messages$x = {
|
|
|
5455
5463
|
}
|
|
5456
5464
|
};
|
|
5457
5465
|
var errors$7 = {
|
|
5458
|
-
|
|
5466
|
+
facebookNoEmail: "Facebook 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Facebook 계정에 이메일을 추가해 주세요.",
|
|
5467
|
+
googleNoEmail: "Google 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Google 계정에 이메일을 추가해 주세요.",
|
|
5468
|
+
auth0NoEmail: "Auth0 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Auth0 계정에 이메일을 추가해 주세요."
|
|
5459
5469
|
};
|
|
5460
5470
|
var login_ko = {
|
|
5461
5471
|
labels: labels$w,
|
|
@@ -5516,7 +5526,9 @@ var messages$v = {
|
|
|
5516
5526
|
}
|
|
5517
5527
|
};
|
|
5518
5528
|
var errors$6 = {
|
|
5519
|
-
|
|
5529
|
+
facebookNoEmail: "Facebook 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Facebook 계정에 이메일을 추가해 주세요.",
|
|
5530
|
+
googleNoEmail: "Google 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Google 계정에 이메일을 추가해 주세요.",
|
|
5531
|
+
auth0NoEmail: "Auth0 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Auth0 계정에 이메일을 추가해 주세요."
|
|
5520
5532
|
};
|
|
5521
5533
|
var gift$1 = {
|
|
5522
5534
|
titles: {
|
|
@@ -6509,7 +6521,9 @@ var messages$e = {
|
|
|
6509
6521
|
}
|
|
6510
6522
|
};
|
|
6511
6523
|
var errors$2 = {
|
|
6512
|
-
|
|
6524
|
+
facebookNoEmail: "Tu cuenta de Facebook no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Facebook.",
|
|
6525
|
+
googleNoEmail: "Tu cuenta de Google no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Google.",
|
|
6526
|
+
auth0NoEmail: "Tu cuenta de Auth0 no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Auth0."
|
|
6513
6527
|
};
|
|
6514
6528
|
var login_es = {
|
|
6515
6529
|
labels: labels$e,
|
|
@@ -6570,7 +6584,9 @@ var messages$c = {
|
|
|
6570
6584
|
}
|
|
6571
6585
|
};
|
|
6572
6586
|
var errors$1 = {
|
|
6573
|
-
|
|
6587
|
+
facebookNoEmail: "Tu cuenta de Facebook no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Facebook.",
|
|
6588
|
+
googleNoEmail: "Tu cuenta de Google no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Google.",
|
|
6589
|
+
auth0NoEmail: "Tu cuenta de Auth0 no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Auth0."
|
|
6574
6590
|
};
|
|
6575
6591
|
var gift = {
|
|
6576
6592
|
titles: {
|
|
@@ -14083,6 +14099,9 @@ const FacebookLoginButton = _ref => {
|
|
|
14083
14099
|
labelClassName = "",
|
|
14084
14100
|
iconClassName = ""
|
|
14085
14101
|
} = _ref;
|
|
14102
|
+
const {
|
|
14103
|
+
t
|
|
14104
|
+
} = useTranslation("login");
|
|
14086
14105
|
const facebookLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id;
|
|
14087
14106
|
const {
|
|
14088
14107
|
dispatch: loginDispatch
|
|
@@ -14091,6 +14110,27 @@ const FacebookLoginButton = _ref => {
|
|
|
14091
14110
|
dispatch: registerDispatch
|
|
14092
14111
|
} = React.useContext(store$m);
|
|
14093
14112
|
const onSuccess = facebookUser => {
|
|
14113
|
+
// Check if email is provided by Facebook
|
|
14114
|
+
if (!(facebookUser !== null && facebookUser !== void 0 && facebookUser.email)) {
|
|
14115
|
+
// Show error message for both login and register stores
|
|
14116
|
+
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14117
|
+
type: SHOW_ALERT,
|
|
14118
|
+
payload: {
|
|
14119
|
+
type: "error",
|
|
14120
|
+
content: t("errors.facebookNoEmail")
|
|
14121
|
+
}
|
|
14122
|
+
});
|
|
14123
|
+
registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
|
|
14124
|
+
type: SHOW_ALERT,
|
|
14125
|
+
payload: {
|
|
14126
|
+
type: "error",
|
|
14127
|
+
content: t("errors.facebookNoEmail")
|
|
14128
|
+
}
|
|
14129
|
+
});
|
|
14130
|
+
return;
|
|
14131
|
+
}
|
|
14132
|
+
|
|
14133
|
+
// Proceed with social login if email is available
|
|
14094
14134
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14095
14135
|
type: HANDLE_SOCIAL_LOGIN,
|
|
14096
14136
|
payload: {
|
|
@@ -14246,6 +14286,9 @@ const GoogleLoginButton = _ref => {
|
|
|
14246
14286
|
labelClassName = "",
|
|
14247
14287
|
iconClassName = ""
|
|
14248
14288
|
} = _ref;
|
|
14289
|
+
const {
|
|
14290
|
+
t
|
|
14291
|
+
} = useTranslation("login");
|
|
14249
14292
|
const googleClientId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.google_app_id;
|
|
14250
14293
|
const {
|
|
14251
14294
|
dispatch: loginDispatch
|
|
@@ -14261,15 +14304,38 @@ const GoogleLoginButton = _ref => {
|
|
|
14261
14304
|
});
|
|
14262
14305
|
}, []);
|
|
14263
14306
|
const onSuccess = response => {
|
|
14264
|
-
var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$
|
|
14307
|
+
var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getGivenName2, _profile$getFamilyNam2;
|
|
14265
14308
|
const profile = response.getBasicProfile();
|
|
14266
14309
|
const accessToken = (_response$getAuthResp = response.getAuthResponse()) === null || _response$getAuthResp === void 0 ? void 0 : _response$getAuthResp.id_token;
|
|
14310
|
+
const email = (_profile$getEmail = profile.getEmail) === null || _profile$getEmail === void 0 ? void 0 : _profile$getEmail.call(profile);
|
|
14311
|
+
|
|
14312
|
+
// Check if email is provided by Google
|
|
14313
|
+
if (!email) {
|
|
14314
|
+
// Show error message for both login and register stores
|
|
14315
|
+
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14316
|
+
type: SHOW_ALERT,
|
|
14317
|
+
payload: {
|
|
14318
|
+
type: "error",
|
|
14319
|
+
content: t("errors.googleNoEmail")
|
|
14320
|
+
}
|
|
14321
|
+
});
|
|
14322
|
+
registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
|
|
14323
|
+
type: SHOW_ALERT,
|
|
14324
|
+
payload: {
|
|
14325
|
+
type: "error",
|
|
14326
|
+
content: t("errors.googleNoEmail")
|
|
14327
|
+
}
|
|
14328
|
+
});
|
|
14329
|
+
return;
|
|
14330
|
+
}
|
|
14331
|
+
|
|
14332
|
+
// Proceed with social login if email is available
|
|
14267
14333
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14268
14334
|
type: HANDLE_SOCIAL_LOGIN,
|
|
14269
14335
|
payload: {
|
|
14270
14336
|
idpName: "google",
|
|
14271
14337
|
idpToken: accessToken,
|
|
14272
|
-
email:
|
|
14338
|
+
email: email,
|
|
14273
14339
|
firstName: (_profile$getGivenName = profile.getGivenName) === null || _profile$getGivenName === void 0 ? void 0 : _profile$getGivenName.call(profile),
|
|
14274
14340
|
lastName: (_profile$getFamilyNam = profile.getFamilyName) === null || _profile$getFamilyNam === void 0 ? void 0 : _profile$getFamilyNam.call(profile)
|
|
14275
14341
|
}
|
|
@@ -14279,7 +14345,7 @@ const GoogleLoginButton = _ref => {
|
|
|
14279
14345
|
payload: {
|
|
14280
14346
|
idpName: "google",
|
|
14281
14347
|
idpToken: accessToken,
|
|
14282
|
-
email:
|
|
14348
|
+
email: email,
|
|
14283
14349
|
firstName: (_profile$getGivenName2 = profile.getGivenName) === null || _profile$getGivenName2 === void 0 ? void 0 : _profile$getGivenName2.call(profile),
|
|
14284
14350
|
lastName: (_profile$getFamilyNam2 = profile.getFamilyName) === null || _profile$getFamilyNam2 === void 0 ? void 0 : _profile$getFamilyNam2.call(profile)
|
|
14285
14351
|
}
|
|
@@ -14351,6 +14417,9 @@ const Auth0LoginButton = _ref => {
|
|
|
14351
14417
|
const {
|
|
14352
14418
|
dispatch: registerDispatch
|
|
14353
14419
|
} = React.useContext(store$m);
|
|
14420
|
+
const {
|
|
14421
|
+
t
|
|
14422
|
+
} = useTranslation("login");
|
|
14354
14423
|
function handleClick() {
|
|
14355
14424
|
var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
|
|
14356
14425
|
if (!auth0Loaded) {
|
|
@@ -14382,6 +14451,28 @@ const Auth0LoginButton = _ref => {
|
|
|
14382
14451
|
given_name,
|
|
14383
14452
|
family_name
|
|
14384
14453
|
} = user;
|
|
14454
|
+
|
|
14455
|
+
// Check if email is provided by Auth0
|
|
14456
|
+
if (!email) {
|
|
14457
|
+
// Show error message for both login and register stores
|
|
14458
|
+
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14459
|
+
type: SHOW_ALERT,
|
|
14460
|
+
payload: {
|
|
14461
|
+
type: "error",
|
|
14462
|
+
content: t("errors.auth0NoEmail")
|
|
14463
|
+
}
|
|
14464
|
+
});
|
|
14465
|
+
registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
|
|
14466
|
+
type: SHOW_ALERT,
|
|
14467
|
+
payload: {
|
|
14468
|
+
type: "error",
|
|
14469
|
+
content: t("errors.auth0NoEmail")
|
|
14470
|
+
}
|
|
14471
|
+
});
|
|
14472
|
+
return;
|
|
14473
|
+
}
|
|
14474
|
+
|
|
14475
|
+
// Proceed with social login if email is available
|
|
14385
14476
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14386
14477
|
type: HANDLE_SOCIAL_LOGIN,
|
|
14387
14478
|
payload: {
|
package/dist/index.esm.js
CHANGED
|
@@ -3511,7 +3511,9 @@ var messages$17 = {
|
|
|
3511
3511
|
}
|
|
3512
3512
|
};
|
|
3513
3513
|
var errors$h = {
|
|
3514
|
-
|
|
3514
|
+
facebookNoEmail: "Your Facebook account doesn't have an email address. Please use a different login method or add an email to your Facebook account.",
|
|
3515
|
+
googleNoEmail: "Your Google account doesn't have an email address. Please use a different login method or add an email to your Google account.",
|
|
3516
|
+
auth0NoEmail: "Your Auth0 account doesn't have an email address. Please use a different login method or add an email to your Auth0 account."
|
|
3515
3517
|
};
|
|
3516
3518
|
var login_en = {
|
|
3517
3519
|
labels: labels$14,
|
|
@@ -3572,7 +3574,9 @@ var messages$15 = {
|
|
|
3572
3574
|
}
|
|
3573
3575
|
};
|
|
3574
3576
|
var errors$g = {
|
|
3575
|
-
|
|
3577
|
+
facebookNoEmail: "Your Facebook account doesn't have an email address. Please use a different login method or add an email to your Facebook account.",
|
|
3578
|
+
googleNoEmail: "Your Google account doesn't have an email address. Please use a different login method or add an email to your Google account.",
|
|
3579
|
+
auth0NoEmail: "Your Auth0 account doesn't have an email address. Please use a different login method or add an email to your Auth0 account."
|
|
3576
3580
|
};
|
|
3577
3581
|
var gift$3 = {
|
|
3578
3582
|
titles: {
|
|
@@ -4473,7 +4477,9 @@ var messages$Q = {
|
|
|
4473
4477
|
}
|
|
4474
4478
|
};
|
|
4475
4479
|
var errors$c = {
|
|
4476
|
-
|
|
4480
|
+
facebookNoEmail: "Votre compte Facebook n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Facebook.",
|
|
4481
|
+
googleNoEmail: "Votre compte Google n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Google.",
|
|
4482
|
+
auth0NoEmail: "Votre compte Auth0 n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Auth0."
|
|
4477
4483
|
};
|
|
4478
4484
|
var login_fr = {
|
|
4479
4485
|
labels: labels$O,
|
|
@@ -4534,7 +4540,9 @@ var messages$O = {
|
|
|
4534
4540
|
}
|
|
4535
4541
|
};
|
|
4536
4542
|
var errors$b = {
|
|
4537
|
-
|
|
4543
|
+
facebookNoEmail: "Votre compte Facebook n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Facebook.",
|
|
4544
|
+
googleNoEmail: "Votre compte Google n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Google.",
|
|
4545
|
+
auth0NoEmail: "Votre compte Auth0 n'a pas d'adresse e-mail. Veuillez utiliser une autre méthode de connexion ou ajouter une adresse e-mail à votre compte Auth0."
|
|
4538
4546
|
};
|
|
4539
4547
|
var gift$2 = {
|
|
4540
4548
|
titles: {
|
|
@@ -5425,7 +5433,9 @@ var messages$x = {
|
|
|
5425
5433
|
}
|
|
5426
5434
|
};
|
|
5427
5435
|
var errors$7 = {
|
|
5428
|
-
|
|
5436
|
+
facebookNoEmail: "Facebook 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Facebook 계정에 이메일을 추가해 주세요.",
|
|
5437
|
+
googleNoEmail: "Google 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Google 계정에 이메일을 추가해 주세요.",
|
|
5438
|
+
auth0NoEmail: "Auth0 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Auth0 계정에 이메일을 추가해 주세요."
|
|
5429
5439
|
};
|
|
5430
5440
|
var login_ko = {
|
|
5431
5441
|
labels: labels$w,
|
|
@@ -5486,7 +5496,9 @@ var messages$v = {
|
|
|
5486
5496
|
}
|
|
5487
5497
|
};
|
|
5488
5498
|
var errors$6 = {
|
|
5489
|
-
|
|
5499
|
+
facebookNoEmail: "Facebook 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Facebook 계정에 이메일을 추가해 주세요.",
|
|
5500
|
+
googleNoEmail: "Google 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Google 계정에 이메일을 추가해 주세요.",
|
|
5501
|
+
auth0NoEmail: "Auth0 계정에 이메일 주소가 없습니다. 다른 로그인 방법을 사용하거나 Auth0 계정에 이메일을 추가해 주세요."
|
|
5490
5502
|
};
|
|
5491
5503
|
var gift$1 = {
|
|
5492
5504
|
titles: {
|
|
@@ -6479,7 +6491,9 @@ var messages$e = {
|
|
|
6479
6491
|
}
|
|
6480
6492
|
};
|
|
6481
6493
|
var errors$2 = {
|
|
6482
|
-
|
|
6494
|
+
facebookNoEmail: "Tu cuenta de Facebook no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Facebook.",
|
|
6495
|
+
googleNoEmail: "Tu cuenta de Google no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Google.",
|
|
6496
|
+
auth0NoEmail: "Tu cuenta de Auth0 no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Auth0."
|
|
6483
6497
|
};
|
|
6484
6498
|
var login_es = {
|
|
6485
6499
|
labels: labels$e,
|
|
@@ -6540,7 +6554,9 @@ var messages$c = {
|
|
|
6540
6554
|
}
|
|
6541
6555
|
};
|
|
6542
6556
|
var errors$1 = {
|
|
6543
|
-
|
|
6557
|
+
facebookNoEmail: "Tu cuenta de Facebook no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Facebook.",
|
|
6558
|
+
googleNoEmail: "Tu cuenta de Google no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Google.",
|
|
6559
|
+
auth0NoEmail: "Tu cuenta de Auth0 no tiene una dirección de correo electrónico. Por favor, usa un método de inicio de sesión diferente o agrega un correo electrónico a tu cuenta de Auth0."
|
|
6544
6560
|
};
|
|
6545
6561
|
var gift = {
|
|
6546
6562
|
titles: {
|
|
@@ -14053,6 +14069,9 @@ const FacebookLoginButton = _ref => {
|
|
|
14053
14069
|
labelClassName = "",
|
|
14054
14070
|
iconClassName = ""
|
|
14055
14071
|
} = _ref;
|
|
14072
|
+
const {
|
|
14073
|
+
t
|
|
14074
|
+
} = useTranslation("login");
|
|
14056
14075
|
const facebookLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id;
|
|
14057
14076
|
const {
|
|
14058
14077
|
dispatch: loginDispatch
|
|
@@ -14061,6 +14080,27 @@ const FacebookLoginButton = _ref => {
|
|
|
14061
14080
|
dispatch: registerDispatch
|
|
14062
14081
|
} = useContext(store$m);
|
|
14063
14082
|
const onSuccess = facebookUser => {
|
|
14083
|
+
// Check if email is provided by Facebook
|
|
14084
|
+
if (!(facebookUser !== null && facebookUser !== void 0 && facebookUser.email)) {
|
|
14085
|
+
// Show error message for both login and register stores
|
|
14086
|
+
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14087
|
+
type: SHOW_ALERT,
|
|
14088
|
+
payload: {
|
|
14089
|
+
type: "error",
|
|
14090
|
+
content: t("errors.facebookNoEmail")
|
|
14091
|
+
}
|
|
14092
|
+
});
|
|
14093
|
+
registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
|
|
14094
|
+
type: SHOW_ALERT,
|
|
14095
|
+
payload: {
|
|
14096
|
+
type: "error",
|
|
14097
|
+
content: t("errors.facebookNoEmail")
|
|
14098
|
+
}
|
|
14099
|
+
});
|
|
14100
|
+
return;
|
|
14101
|
+
}
|
|
14102
|
+
|
|
14103
|
+
// Proceed with social login if email is available
|
|
14064
14104
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14065
14105
|
type: HANDLE_SOCIAL_LOGIN,
|
|
14066
14106
|
payload: {
|
|
@@ -14216,6 +14256,9 @@ const GoogleLoginButton = _ref => {
|
|
|
14216
14256
|
labelClassName = "",
|
|
14217
14257
|
iconClassName = ""
|
|
14218
14258
|
} = _ref;
|
|
14259
|
+
const {
|
|
14260
|
+
t
|
|
14261
|
+
} = useTranslation("login");
|
|
14219
14262
|
const googleClientId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.google_app_id;
|
|
14220
14263
|
const {
|
|
14221
14264
|
dispatch: loginDispatch
|
|
@@ -14231,15 +14274,38 @@ const GoogleLoginButton = _ref => {
|
|
|
14231
14274
|
});
|
|
14232
14275
|
}, []);
|
|
14233
14276
|
const onSuccess = response => {
|
|
14234
|
-
var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$
|
|
14277
|
+
var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getGivenName2, _profile$getFamilyNam2;
|
|
14235
14278
|
const profile = response.getBasicProfile();
|
|
14236
14279
|
const accessToken = (_response$getAuthResp = response.getAuthResponse()) === null || _response$getAuthResp === void 0 ? void 0 : _response$getAuthResp.id_token;
|
|
14280
|
+
const email = (_profile$getEmail = profile.getEmail) === null || _profile$getEmail === void 0 ? void 0 : _profile$getEmail.call(profile);
|
|
14281
|
+
|
|
14282
|
+
// Check if email is provided by Google
|
|
14283
|
+
if (!email) {
|
|
14284
|
+
// Show error message for both login and register stores
|
|
14285
|
+
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14286
|
+
type: SHOW_ALERT,
|
|
14287
|
+
payload: {
|
|
14288
|
+
type: "error",
|
|
14289
|
+
content: t("errors.googleNoEmail")
|
|
14290
|
+
}
|
|
14291
|
+
});
|
|
14292
|
+
registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
|
|
14293
|
+
type: SHOW_ALERT,
|
|
14294
|
+
payload: {
|
|
14295
|
+
type: "error",
|
|
14296
|
+
content: t("errors.googleNoEmail")
|
|
14297
|
+
}
|
|
14298
|
+
});
|
|
14299
|
+
return;
|
|
14300
|
+
}
|
|
14301
|
+
|
|
14302
|
+
// Proceed with social login if email is available
|
|
14237
14303
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14238
14304
|
type: HANDLE_SOCIAL_LOGIN,
|
|
14239
14305
|
payload: {
|
|
14240
14306
|
idpName: "google",
|
|
14241
14307
|
idpToken: accessToken,
|
|
14242
|
-
email:
|
|
14308
|
+
email: email,
|
|
14243
14309
|
firstName: (_profile$getGivenName = profile.getGivenName) === null || _profile$getGivenName === void 0 ? void 0 : _profile$getGivenName.call(profile),
|
|
14244
14310
|
lastName: (_profile$getFamilyNam = profile.getFamilyName) === null || _profile$getFamilyNam === void 0 ? void 0 : _profile$getFamilyNam.call(profile)
|
|
14245
14311
|
}
|
|
@@ -14249,7 +14315,7 @@ const GoogleLoginButton = _ref => {
|
|
|
14249
14315
|
payload: {
|
|
14250
14316
|
idpName: "google",
|
|
14251
14317
|
idpToken: accessToken,
|
|
14252
|
-
email:
|
|
14318
|
+
email: email,
|
|
14253
14319
|
firstName: (_profile$getGivenName2 = profile.getGivenName) === null || _profile$getGivenName2 === void 0 ? void 0 : _profile$getGivenName2.call(profile),
|
|
14254
14320
|
lastName: (_profile$getFamilyNam2 = profile.getFamilyName) === null || _profile$getFamilyNam2 === void 0 ? void 0 : _profile$getFamilyNam2.call(profile)
|
|
14255
14321
|
}
|
|
@@ -14321,6 +14387,9 @@ const Auth0LoginButton = _ref => {
|
|
|
14321
14387
|
const {
|
|
14322
14388
|
dispatch: registerDispatch
|
|
14323
14389
|
} = useContext(store$m);
|
|
14390
|
+
const {
|
|
14391
|
+
t
|
|
14392
|
+
} = useTranslation("login");
|
|
14324
14393
|
function handleClick() {
|
|
14325
14394
|
var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
|
|
14326
14395
|
if (!auth0Loaded) {
|
|
@@ -14352,6 +14421,28 @@ const Auth0LoginButton = _ref => {
|
|
|
14352
14421
|
given_name,
|
|
14353
14422
|
family_name
|
|
14354
14423
|
} = user;
|
|
14424
|
+
|
|
14425
|
+
// Check if email is provided by Auth0
|
|
14426
|
+
if (!email) {
|
|
14427
|
+
// Show error message for both login and register stores
|
|
14428
|
+
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14429
|
+
type: SHOW_ALERT,
|
|
14430
|
+
payload: {
|
|
14431
|
+
type: "error",
|
|
14432
|
+
content: t("errors.auth0NoEmail")
|
|
14433
|
+
}
|
|
14434
|
+
});
|
|
14435
|
+
registerDispatch === null || registerDispatch === void 0 ? void 0 : registerDispatch({
|
|
14436
|
+
type: SHOW_ALERT,
|
|
14437
|
+
payload: {
|
|
14438
|
+
type: "error",
|
|
14439
|
+
content: t("errors.auth0NoEmail")
|
|
14440
|
+
}
|
|
14441
|
+
});
|
|
14442
|
+
return;
|
|
14443
|
+
}
|
|
14444
|
+
|
|
14445
|
+
// Proceed with social login if email is available
|
|
14355
14446
|
loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
|
|
14356
14447
|
type: HANDLE_SOCIAL_LOGIN,
|
|
14357
14448
|
payload: {
|