Basic dashboard for newsletter issue and password systems
This commit is contained in:
@@ -6,11 +6,10 @@ use crate::{
|
||||
use axum::{
|
||||
Extension, Form,
|
||||
extract::State,
|
||||
response::{Html, IntoResponse, Redirect, Response},
|
||||
response::{IntoResponse, Redirect, Response},
|
||||
};
|
||||
use axum_messages::Messages;
|
||||
use secrecy::{ExposeSecret, SecretString};
|
||||
use std::fmt::Write;
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct PasswordFormData {
|
||||
@@ -19,18 +18,6 @@ pub struct PasswordFormData {
|
||||
pub new_password_check: SecretString,
|
||||
}
|
||||
|
||||
pub async fn change_password_form(messages: Messages) -> Result<Response, AdminError> {
|
||||
let mut error_html = String::new();
|
||||
for message in messages {
|
||||
writeln!(error_html, "<p><i>{}</i></p>", message).unwrap();
|
||||
}
|
||||
Ok(Html(format!(
|
||||
include_str!("html/change_password_form.html"),
|
||||
error_html
|
||||
))
|
||||
.into_response())
|
||||
}
|
||||
|
||||
pub async fn change_password(
|
||||
Extension(AuthenticatedUser { user_id, username }): Extension<AuthenticatedUser>,
|
||||
State(AppState {
|
||||
|
||||
Reference in New Issue
Block a user