diff --git a/server/app/register.php b/server/app/register.php index ee1c563..c62f3be 100644 --- a/server/app/register.php +++ b/server/app/register.php @@ -43,8 +43,18 @@ // Hashing the given password $password = hash('sha256', $password); - // Sending a request to the database to add the user - Core\Queries::execute('INSERT INTO openauth_users (guid, uuid, username, password) VALUES (:guid, :uuid, :username, :password)', ['username' => $username, 'uuid' => $uuid, "password" => $password, 'guid' => $guid]); + $accessToken = md5(uniqid(rand(), true)); + $clientToken = getClientToken(); + + Core\Queries::execute( + 'INSERT INTO openauth_users (guid, uuid, username, password, accessToken, clientToken) VALUES (:guid, :uuid, :username, :password, :accessToken, :clientToken)', [ + 'username' => $username, + 'uuid' => $uuid, + 'password' => $password, + 'guid' => $guid, + 'accessToken' => $accessToken, + 'clientToken' => $clientToken] + ); // Setting the 'You are now suscribed' message $notif = "Vous ĂȘtes bien inscrits !"; @@ -120,4 +130,4 @@ - \ No newline at end of file +