Add HashedPassword::auth_hash
This commit is contained in:
@@ -35,6 +35,13 @@ use pbkdf2::{PasswordHasher, Pbkdf2};
|
|||||||
#[diesel(sql_type = sql_types::Text)]
|
#[diesel(sql_type = sql_types::Text)]
|
||||||
pub struct HashedPassword(String);
|
pub struct HashedPassword(String);
|
||||||
|
|
||||||
|
impl HashedPassword {
|
||||||
|
/// Returns the "session auth hash" for `axum-login`, just the hashed password as bytes
|
||||||
|
pub fn auth_hash(&self) -> &[u8] {
|
||||||
|
self.0.as_bytes()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<DB> FromSql<diesel::sql_types::Text, DB> for HashedPassword
|
impl<DB> FromSql<diesel::sql_types::Text, DB> for HashedPassword
|
||||||
where
|
where
|
||||||
DB: diesel::backend::Backend,
|
DB: diesel::backend::Backend,
|
||||||
|
|||||||
Reference in New Issue
Block a user