refactor(accounts): switched from deprecated function `base64::encode()` to `base64::Engine::encode()`
This commit is contained in:
parent
8fd807e450
commit
f7e02dc794
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT * FROM Projects WHERE id = $1;",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "created",
|
||||||
|
"type_info": "Timestamp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "members",
|
||||||
|
"type_info": "Int8Array"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Int8"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "bdcf043d394bc561cd8c7dcdb27943e04b4b796f18f6d1abb0608d5dae3bc0cd"
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ use argon2::{
|
||||||
password_hash::{rand_core::OsRng, PasswordHash, PasswordHasher, PasswordVerifier, SaltString},
|
password_hash::{rand_core::OsRng, PasswordHash, PasswordHasher, PasswordVerifier, SaltString},
|
||||||
Argon2,
|
Argon2,
|
||||||
};
|
};
|
||||||
use base64;
|
use base64::{Engine, engine::general_purpose::STANDARD as Base64Engine};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use sqlx::{postgres::PgPool, types::chrono as sqlx_chrono};
|
use sqlx::{postgres::PgPool, types::chrono as sqlx_chrono};
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ impl Account {
|
||||||
let email_hash = {
|
let email_hash = {
|
||||||
let mut hasher = Sha256::new();
|
let mut hasher = Sha256::new();
|
||||||
hasher.update(email.as_bytes());
|
hasher.update(email.as_bytes());
|
||||||
base64::encode(hasher.finalize())
|
Base64Engine.encode(hasher.finalize())
|
||||||
};
|
};
|
||||||
|
|
||||||
let joined = sqlx_chrono::Utc::now().naive_utc();
|
let joined = sqlx_chrono::Utc::now().naive_utc();
|
||||||
|
@ -154,7 +154,7 @@ impl Account {
|
||||||
let email_hash = {
|
let email_hash = {
|
||||||
let mut hasher = Sha256::new();
|
let mut hasher = Sha256::new();
|
||||||
hasher.update(email.as_bytes());
|
hasher.update(email.as_bytes());
|
||||||
base64::encode(hasher.finalize())
|
Base64Engine.encode(hasher.finalize())
|
||||||
};
|
};
|
||||||
|
|
||||||
match sqlx::query_as!(
|
match sqlx::query_as!(
|
||||||
|
|
Loading…
Reference in New Issue