Bloep.
This commit is contained in:
@@ -9,7 +9,7 @@ pub async fn get_by_hash<'e, E>(
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let row = sqlx::query_as!(
|
||||
sqlx::query_as!(
|
||||
AccessTokenRow,
|
||||
r#"
|
||||
SELECT
|
||||
@@ -27,9 +27,7 @@ where
|
||||
)
|
||||
.fetch_optional(executor)
|
||||
.await
|
||||
.map_err(DatabaseError::from)?;
|
||||
|
||||
Ok(row)
|
||||
.map_err(DatabaseError::from)
|
||||
}
|
||||
|
||||
pub async fn get_by_refresh_secret_hash<'e, E>(
|
||||
@@ -39,7 +37,7 @@ pub async fn get_by_refresh_secret_hash<'e, E>(
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let row = sqlx::query_as!(
|
||||
sqlx::query_as!(
|
||||
AccessTokenRow,
|
||||
r#"
|
||||
SELECT
|
||||
@@ -58,9 +56,7 @@ where
|
||||
)
|
||||
.fetch_optional(executor)
|
||||
.await
|
||||
.map_err(DatabaseError::from)?;
|
||||
|
||||
Ok(row)
|
||||
.map_err(DatabaseError::from)
|
||||
}
|
||||
|
||||
pub async fn upsert<'e, E>(
|
||||
@@ -145,7 +141,7 @@ pub async fn delete_by_hash<'e, E>(
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let row = sqlx::query_as!(
|
||||
sqlx::query_as!(
|
||||
AccessTokenRow,
|
||||
r#"
|
||||
DELETE FROM access_tokens
|
||||
@@ -156,7 +152,5 @@ where
|
||||
)
|
||||
.fetch_optional(executor)
|
||||
.await
|
||||
.map_err(DatabaseError::from)?;
|
||||
|
||||
Ok(row)
|
||||
.map_err(DatabaseError::from)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ pub async fn get_by_hash<'e, E>(
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let row = sqlx::query_as!(
|
||||
sqlx::query_as!(
|
||||
RefreshTokenRow,
|
||||
r#"
|
||||
SELECT
|
||||
@@ -26,9 +26,7 @@ where
|
||||
)
|
||||
.fetch_optional(executor)
|
||||
.await
|
||||
.map_err(DatabaseError::from)?;
|
||||
|
||||
Ok(row)
|
||||
.map_err(DatabaseError::from)
|
||||
}
|
||||
|
||||
pub async fn upsert<'e, E>(
|
||||
@@ -107,7 +105,7 @@ pub async fn delete_by_hash<'e, E>(
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let row = sqlx::query_as!(
|
||||
sqlx::query_as!(
|
||||
RefreshTokenRow,
|
||||
r#"
|
||||
DELETE FROM refresh_tokens
|
||||
@@ -118,7 +116,5 @@ where
|
||||
)
|
||||
.fetch_optional(executor)
|
||||
.await
|
||||
.map_err(DatabaseError::from)?;
|
||||
|
||||
Ok(row)
|
||||
.map_err(DatabaseError::from)
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ pub async fn verify<'e, E>(
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
let is_valid = sqlx::query_scalar!(
|
||||
sqlx::query_scalar!(
|
||||
r#"
|
||||
SELECT EXISTS (
|
||||
SELECT 1
|
||||
@@ -156,9 +156,7 @@ where
|
||||
)
|
||||
.fetch_one(executor)
|
||||
.await
|
||||
.map_err(DatabaseError::from)?;
|
||||
|
||||
Ok(is_valid)
|
||||
.map_err(DatabaseError::from)
|
||||
}
|
||||
|
||||
pub async fn delete_by_id<'e, E>(
|
||||
|
||||
Reference in New Issue
Block a user