2021-02-02, 04:09 PM
(2021-02-01, 08:30 PM)Behemoth Wrote:Code:mysql_format(dbConnection, query, sizeof(query), "SELECT acc_pass FROM accounts WHERE acc_user = '%e'", ReturnName(playerid));
mysql_tquery(dbConnection, query);
cache_get_value_name(0, "acc_pass", password, 256);
bcrypt_hash(0, "LoginVerification", password, 12);
Code:forward LoginVerification(playerid);
public LoginVerification(playerid) {
new
hash[256], check[256];
bcrypt_get_hash(hash);
bcrypt_verify(playerid, "HashCheck", hash, check);
return 1;
}
forward HashCheck(playerid, bool:success);
public HashCheck(playerid, bool:success) {
if(success) {
return SendClientMessage(playerid, COLOR_LIGHTRED, "IT WORKS CUNT");
}
return 1;
I have a feeling this is entirely wrong but I was just guessing at this point, was hoping for a guide on how to properly use this. nohate lol
I believe you do not need to pass the hashed version of the password into bcrypt_verify, instead you pass the stored hash and the plaintext input.
So when logging in, you can skip the entire process with "LoginVerification" and just instantly jump to bcrypt_verify with HashCheck.