Add sign up

This commit is contained in:
eraden 2024-01-27 21:23:42 +01:00
parent 9805a96510
commit df64f13952
3 changed files with 4 additions and 5 deletions

View File

@ -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());

View File

@ -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

View File

@ -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 {