Confirmation page and minor improvements to homepage and form messages
Basic redirect with flash messages for success and error messages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::startup::AppState;
|
||||
use askama::Template;
|
||||
use axum::{
|
||||
extract::{Query, State},
|
||||
http::StatusCode,
|
||||
@@ -8,6 +9,10 @@ use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/confirm.html")]
|
||||
struct ConfirmTemplate;
|
||||
|
||||
#[tracing::instrument(name = "Confirming new subscriber", skip(params))]
|
||||
pub async fn confirm(
|
||||
State(AppState {
|
||||
@@ -27,7 +32,7 @@ pub async fn confirm(
|
||||
{
|
||||
StatusCode::INTERNAL_SERVER_ERROR.into_response()
|
||||
} else {
|
||||
Html(include_str!("register/confirm.html")).into_response()
|
||||
Html(ConfirmTemplate.render().unwrap()).into_response()
|
||||
}
|
||||
} else {
|
||||
StatusCode::UNAUTHORIZED.into_response()
|
||||
|
||||
Reference in New Issue
Block a user