Base login setup

This commit is contained in:
LeNei
2025-03-28 15:18:59 +01:00
parent 15e834060d
commit 894d58c6c9
35 changed files with 1405 additions and 23 deletions

23
src/models/mod.rs Normal file
View File

@@ -0,0 +1,23 @@
pub mod user;
use axum::response::{IntoResponse, Redirect, Response};
use tokio::task;
#[derive(Debug, thiserror::Error)]
pub enum InertiaError {
#[error(transparent)]
Sqlx(#[from] sqlx::Error),
#[error(transparent)]
TaskJoin(#[from] task::JoinError),
#[error("Something went wrong")]
Unknown,
}
impl IntoResponse for InertiaError {
fn into_response(self) -> Response {
tracing::error!("Error: {:?}", self);
Redirect::to("/error").into_response()
}
}