Reimplemented access and refresh tokens.
This commit is contained in:
@@ -5,7 +5,7 @@ use super::{
|
||||
};
|
||||
use crate::{
|
||||
database::{self, Constraint, DatabaseError, dtos::UserAppSecretRow},
|
||||
domain::UserAppSecret,
|
||||
domain::{HashedSecret, UserAppSecret},
|
||||
repository::DecodeError,
|
||||
};
|
||||
|
||||
@@ -95,12 +95,12 @@ fn classify_upsert_error(error: DatabaseError) -> RepositoryError {
|
||||
pub async fn verify<'e, E>(
|
||||
executor: E,
|
||||
app_id: Uuid,
|
||||
secret_hash: &[u8],
|
||||
secret_hash: &HashedSecret,
|
||||
) -> Result<bool, RepositoryError>
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let is_valid = database::user_app_secrets::verify(executor, app_id, secret_hash).await?;
|
||||
let is_valid = database::user_app_secrets::verify(executor, app_id, secret_hash.hash()).await?;
|
||||
|
||||
Ok(is_valid)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user