@movalib/movalib-commons 1.2.24 → 1.2.26

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.
@@ -61,6 +61,27 @@ var AccountValidation = function (_a) {
61
61
  // Si cette variable est transmise, cela signifie que le compte a été créé sans mot de passe
62
62
  var localEmptyPwd = Boolean(params.get('emptyPwd'));
63
63
  setEmptyPwd(localEmptyPwd);
64
+ if (token) {
65
+ setLoading(true);
66
+ try {
67
+ UserService_1.default.existsByToken(token)
68
+ .then(function (response) {
69
+ var _a;
70
+ Logger_1.default.info(response);
71
+ if (response.success) {
72
+ // Si le compte est déjà actif, on appelle le callback de succès
73
+ if ((_a = response.data) === null || _a === void 0 ? void 0 : _a.isActive)
74
+ onSubmit(true, "Votre compte est activé !");
75
+ }
76
+ });
77
+ }
78
+ catch (error) {
79
+ Logger_1.default.error('Error occurred during submission:', error);
80
+ }
81
+ finally {
82
+ setLoading(false);
83
+ }
84
+ }
64
85
  if (token && !resetPassword) {
65
86
  if (!localEmptyPwd) {
66
87
  var req = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -59,6 +59,30 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
59
59
  // Si cette variable est transmise, cela signifie que le compte a été créé sans mot de passe
60
60
  let localEmptyPwd = Boolean(params.get('emptyPwd'));
61
61
  setEmptyPwd(localEmptyPwd);
62
+
63
+ if(token){
64
+ setLoading(true);
65
+
66
+ try {
67
+
68
+ UserService.existsByToken(token)
69
+ .then(response => {
70
+
71
+ Logger.info(response);
72
+
73
+ if(response.success){
74
+ // Si le compte est déjà actif, on appelle le callback de succès
75
+ if(response.data?.isActive)
76
+ onSubmit(true, "Votre compte est activé !");
77
+ }
78
+ });
79
+
80
+ }catch (error){
81
+ Logger.error('Error occurred during submission:', error);
82
+ }finally {
83
+ setLoading(false);
84
+ }
85
+ }
62
86
 
63
87
  if (token && !resetPassword) {
64
88