Skip to content

Commit

Permalink
surreal lints
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Feb 11, 2024
1 parent 85d954b commit 83dadd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ impl Backend {
email: String,
password: String,
) -> Result<AuthenticatedUser> {
(*self.surreal_client).use_ns("main").await?;
(*self.surreal_client).use_db("main").await?;
(*self.surreal_client).use_ns("main").use_db("main").await?;

// check whether a user with the given email already exists
let user: Option<AuthenticatedUser> = (*self.surreal_client)
Expand Down Expand Up @@ -97,8 +96,7 @@ impl AuthnBackend for Backend {
&self,
credentials: Self::Credentials,
) -> Result<Option<Self::User>, Self::Error> {
(*self.surreal_client).use_ns("main").await?;
(*self.surreal_client).use_db("main").await?;
(*self.surreal_client).use_ns("main").use_db("main").await?;

let user: Option<AuthenticatedUser> = (*self.surreal_client)
.query(
Expand All @@ -117,6 +115,8 @@ impl AuthnBackend for Backend {
&self,
user_id: &UserId<Self>,
) -> Result<Option<Self::User>, Self::Error> {
(*self.surreal_client).use_ns("main").use_db("main").await?;

let user: Option<AuthenticatedUser> =
(*self.surreal_client).select(user_id).await?;
Ok(user)
Expand Down

0 comments on commit 83dadd0

Please sign in to comment.