Cleaning
This commit is contained in:
parent
198bff6e4a
commit
6f014ef238
19 changed files with 118 additions and 81 deletions
|
|
@ -20,6 +20,7 @@ use tracing::{error, warn};
|
|||
|
||||
use crate::{
|
||||
app::{AppState, Context, Result},
|
||||
config::Config,
|
||||
consts,
|
||||
data::db,
|
||||
email,
|
||||
|
|
@ -88,6 +89,7 @@ enum SignUpError {
|
|||
#[debug_handler(state = AppState)]
|
||||
pub async fn sign_up_post(
|
||||
Host(host): Host,
|
||||
State(config): State<Config>,
|
||||
State(connection): State<db::Connection>,
|
||||
State(email_service): State<Arc<dyn email::EmailServiceTrait>>,
|
||||
Extension(context): Extension<Context>,
|
||||
|
|
@ -171,6 +173,7 @@ pub async fn sign_up_post(
|
|||
let email = form_data.email.clone();
|
||||
match email_service
|
||||
.send_email(
|
||||
&config.email_address,
|
||||
&email,
|
||||
context.tr.t(Sentence::SignUpEmailTitle),
|
||||
&context.tr.tp(
|
||||
|
|
@ -385,7 +388,6 @@ pub async fn sign_in_post(
|
|||
#[debug_handler]
|
||||
pub async fn sign_out(
|
||||
State(connection): State<db::Connection>,
|
||||
Extension(context): Extension<Context>,
|
||||
req: Request<Body>,
|
||||
) -> Result<(CookieJar, Redirect)> {
|
||||
let mut jar = CookieJar::from_headers(req.headers());
|
||||
|
|
@ -450,6 +452,7 @@ enum AskResetPasswordError {
|
|||
#[debug_handler(state = AppState)]
|
||||
pub async fn ask_reset_password_post(
|
||||
Host(host): Host,
|
||||
State(config): State<Config>,
|
||||
State(connection): State<db::Connection>,
|
||||
State(email_service): State<Arc<dyn email::EmailServiceTrait>>,
|
||||
Extension(context): Extension<Context>,
|
||||
|
|
@ -522,6 +525,7 @@ pub async fn ask_reset_password_post(
|
|||
let url = utils::get_url_from_host(&host);
|
||||
match email_service
|
||||
.send_email(
|
||||
&config.email_address,
|
||||
&form_data.email,
|
||||
context.tr.t(Sentence::AskResetEmailTitle),
|
||||
&context.tr.tp(
|
||||
|
|
@ -755,6 +759,7 @@ enum ProfileUpdateError {
|
|||
#[debug_handler(state = AppState)]
|
||||
pub async fn edit_user_post(
|
||||
Host(host): Host,
|
||||
State(config): State<Config>,
|
||||
State(connection): State<db::Connection>,
|
||||
State(email_service): State<Arc<dyn email::EmailServiceTrait>>,
|
||||
Extension(context): Extension<Context>,
|
||||
|
|
@ -859,6 +864,7 @@ pub async fn edit_user_post(
|
|||
let email = form_data.email.clone();
|
||||
match email_service
|
||||
.send_email(
|
||||
&config.email_address,
|
||||
&email,
|
||||
context.tr.t(Sentence::ProfileFollowEmailTitle),
|
||||
&context.tr.tp(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue