Add sign up
This commit is contained in:
parent
9805a96510
commit
df64f13952
@ -89,7 +89,7 @@ async fn try_sign_in(
|
||||
.await
|
||||
{
|
||||
Ok(None) => {}
|
||||
Ok(Some(user)) => return Err(JsonError::new("User with this email already exists")),
|
||||
Ok(Some(_user)) => return Err(JsonError::new("User with this email already exists")),
|
||||
Err(e) => {
|
||||
tracing::error!("Failed to load user for sign-in: {e}");
|
||||
return Ok(Error::DatabaseError.error_response());
|
||||
|
@ -78,7 +78,7 @@ async fn try_sign_in(
|
||||
return Err(JsonError::new("Please provide a valid email address."));
|
||||
}
|
||||
|
||||
let (user, was_created) = match Users::find()
|
||||
let (user, _was_created) = match Users::find()
|
||||
.filter(entities::users::Column::Email.eq(&email))
|
||||
.one(&mut *db)
|
||||
.await
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::env::var as env_var;
|
||||
|
||||
use super::{auth_http_response, AuthError, AuthResponseBody};
|
||||
use actix_jwt_session::{JwtTtl, RefreshTtl, JWT_HEADER_NAME, REFRESH_HEADER_NAME};
|
||||
use super::{auth_http_response, AuthError};
|
||||
|
||||
use actix_web::{
|
||||
get,
|
||||
web::{self, Data, ServiceConfig},
|
||||
@ -37,7 +37,6 @@ use tracing::{debug, error, warn};
|
||||
use crate::{
|
||||
http::OAuthError,
|
||||
models::{Error, JsonError},
|
||||
session::AppClaims,
|
||||
};
|
||||
|
||||
macro_rules! oauth_envs {
|
||||
|
Loading…
Reference in New Issue
Block a user