Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

5 changes: 1 addition & 4 deletions crates/defguard_common/src/db/models/auth_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ impl From<AuthCode<Id>> for AuthCode<NoId> {
impl AuthCode<Id> {
/// Find by code.
/// If found, delete `AuthCode` from the database right away, so it can't be reused.
pub async fn find_code<'e, E>(
executor: E,
code: &str,
) -> Result<Option<AuthCode<NoId>>, sqlx::Error>
pub async fn find_code<'e, E>(executor: E, code: &str) -> sqlx::Result<Option<AuthCode<NoId>>>
where
E: PgExecutor<'e>,
{
Expand Down
4 changes: 2 additions & 2 deletions crates/defguard_common/src/db/models/authentication_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fmt::Display;

use model_derive::Model;
use serde::{Deserialize, Serialize};
use sqlx::{Error as SqlxError, PgExecutor, Type, query_as};
use sqlx::{PgExecutor, Type, query_as};

use crate::db::{Id, NoId};

Expand Down Expand Up @@ -60,7 +60,7 @@ impl AuthenticationKey<Id> {
executor: E,
user_id: Id,
key_type: Option<AuthenticationKeyType>,
) -> Result<Vec<Self>, SqlxError>
) -> sqlx::Result<Vec<Self>>
where
E: PgExecutor<'e>,
{
Expand Down
13 changes: 3 additions & 10 deletions crates/defguard_common/src/db/models/biometric_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ impl BiometricAuth {
}

impl BiometricAuth<Id> {
pub async fn find_by_device_id<'e, E>(
executor: E,
device_id: Id,
) -> Result<Option<Self>, sqlx::Error>
pub async fn find_by_device_id<'e, E>(executor: E, device_id: Id) -> sqlx::Result<Option<Self>>
where
E: PgExecutor<'e>,
{
Expand All @@ -73,11 +70,7 @@ impl BiometricAuth<Id> {
.await
}

pub async fn verify_owner<'e, E>(
executor: E,
user_id: Id,
pub_key: &str,
) -> Result<bool, sqlx::Error>
pub async fn verify_owner<'e, E>(executor: E, user_id: Id, pub_key: &str) -> sqlx::Result<bool>
where
E: PgExecutor<'e>,
{
Expand All @@ -91,7 +84,7 @@ impl BiometricAuth<Id> {
Ok(q_result.is_some())
}

pub async fn find_by_user_id<'e, E>(executor: E, user_id: Id) -> Result<Vec<Self>, sqlx::Error>
pub async fn find_by_user_id<'e, E>(executor: E, user_id: Id) -> sqlx::Result<Vec<Self>>
where
E: PgExecutor<'e>,
{
Expand Down
Loading
Loading