Browse Source

Fixe error Authent

stany.ferer 1 year ago
parent
commit
b6d9f8acbe
2 changed files with 7 additions and 1 deletions
  1. 2 0
      core/class/jwt.class.php
  2. 5 1
      core/class/user.class.php

+ 2 - 0
core/class/jwt.class.php

@@ -39,6 +39,8 @@ class jwt
             self::$jwtToken = $user["token"];
             return $user;
 
+        } else {
+            return FALSE;
         }
     }
 

+ 5 - 1
core/class/user.class.php

@@ -153,6 +153,7 @@ class user {
                     "prenom" => $row["prenom"],
                     "nom" => $row["nom"],
                     "googleAuthenticator" => $row["googleAuthenticator"],
+                    "googleAuthenticatorSecret" => $row["googleAuthenticatorSecret"],
                     "idType" => $row["id_type"],
                     "email" => $row["email"],
                     "actif" => $row["actif"],
@@ -179,7 +180,7 @@ class user {
 
         if ($connect["googleAuthenticator"] == 1 and DOMAIN_CONTROL != $_SERVER['SERVER_NAME']) {
             if (googleAuthenticator::verifyCode($connect["googleAuthenticatorSecret"], $_input["authenticator"], 1) == FALSE) {
-                $row["id"] = NULL;
+                $connect["id"] = NULL;
             }
         }
 
@@ -211,6 +212,9 @@ class user {
                     return FALSE;
                 }
             }
+        } else {
+            alert::recError("Erreur d'authentification");
+            return FALSE;
         }
     }