Askama message template
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::{
|
||||
authentication::{self, AuthenticatedUser, Credentials, validate_credentials},
|
||||
routes::AdminError,
|
||||
startup::AppState,
|
||||
templates::SuccessTemplate,
|
||||
templates::MessageTemplate,
|
||||
};
|
||||
use askama::Template;
|
||||
use axum::{
|
||||
@@ -47,8 +47,8 @@ pub async fn change_password(
|
||||
authentication::change_password(user_id, form.new_password, &connection_pool)
|
||||
.await
|
||||
.map_err(|e| AdminError::ChangePassword(e.to_string()))?;
|
||||
let template = SuccessTemplate {
|
||||
success_message: "Your password has been changed.".to_string(),
|
||||
let template = MessageTemplate::Success {
|
||||
message: "Your password has been changed.".to_string(),
|
||||
};
|
||||
Ok(Html(template.render().unwrap()).into_response())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user