Compare commits
6 Commits
87bd1b50a9
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
d5eba9620c
|
|||
|
39afdd83a7
|
|||
|
34b887730a
|
|||
|
f2dc4c908e
|
|||
|
219f1f5e7d
|
|||
|
102387fdad
|
@@ -20,7 +20,7 @@ dioxus = { version = "0.7.9", features = ["router", "fullstack"] }
|
|||||||
dioxus-html = "0.7.9"
|
dioxus-html = "0.7.9"
|
||||||
dotenvy = { version = "0.15.7", optional = true }
|
dotenvy = { version = "0.15.7", optional = true }
|
||||||
fred = { version = "10.1.0", optional = true }
|
fred = { version = "10.1.0", optional = true }
|
||||||
lucide-dioxus = { version = "3.11.0", features = ["notifications"] }
|
lucide-dioxus = { version = "3.11.0", features = ["notifications", "account"] }
|
||||||
pbkdf2 = { version = "0.13.0", optional = true, features = ["getrandom", "phc"] }
|
pbkdf2 = { version = "0.13.0", optional = true, features = ["getrandom", "phc"] }
|
||||||
rand = "0.10.1"
|
rand = "0.10.1"
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ enum Route {
|
|||||||
#[component]
|
#[component]
|
||||||
pub fn App() -> Element {
|
pub fn App() -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
|
document::Link { rel: "icon", href: LOGO_ICO }
|
||||||
document::Link { rel: "stylesheet", href: TAILWIND_CSS }
|
document::Link { rel: "stylesheet", href: TAILWIND_CSS }
|
||||||
Router::<Route> {}
|
Router::<Route> {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,3 +37,32 @@ pub fn FormInput(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn UsernameInput() -> Element {
|
||||||
|
rsx! {
|
||||||
|
FormInput {
|
||||||
|
label: "Username",
|
||||||
|
required: true,
|
||||||
|
|
||||||
|
lucide_dioxus::UserRound {
|
||||||
|
class: "opacity-50",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn PasswordInput() -> Element {
|
||||||
|
rsx! {
|
||||||
|
FormInput {
|
||||||
|
label: "Password",
|
||||||
|
required: true,
|
||||||
|
r#type: "password",
|
||||||
|
|
||||||
|
lucide_dioxus::KeyRound {
|
||||||
|
class: "opacity-50",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
pub mod footer;
|
pub mod footer;
|
||||||
pub mod form;
|
pub mod form;
|
||||||
pub mod form_input;
|
pub mod form_input;
|
||||||
|
|
||||||
|
pub use footer::*;
|
||||||
|
pub use form::*;
|
||||||
|
pub use form_input::*;
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ use crate::app::App;
|
|||||||
fn tracing_setup() {
|
fn tracing_setup() {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
dioxus::logger::init(tracing::Level::DEBUG).expect("Failed to initialize tracing logger");
|
dioxus::logger::init(tracing::Level::DEBUG).expect("Failed to initialize tracing logger");
|
||||||
|
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
dioxus::logger::init(tracing::Level::INFO).expect("Failed to initialize tracing logger");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "server"))]
|
#[cfg(not(feature = "server"))]
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ const ALLOWED_PATH_PREFIX: [&str; 1] = ["/assets/"];
|
|||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
const ALLOWED_PATH_PREFIX: [&str; 2] = ["/assets/", "/wasm/"];
|
const ALLOWED_PATH_PREFIX: [&str; 2] = ["/assets/", "/wasm/"];
|
||||||
|
|
||||||
const ALLOWED_PATHS: [&str; 5] = [
|
const ALLOWED_PATHS: [&str; 6] = [
|
||||||
"/login",
|
"/login",
|
||||||
"/signup",
|
"/signup",
|
||||||
"/api/v1/auth/login",
|
"/api/v1/auth/login",
|
||||||
"/api/v1/auth/signup",
|
"/api/v1/auth/signup",
|
||||||
"/api/v1/auth/user",
|
"/api/v1/auth/user",
|
||||||
|
"/api/v1/auth/open-signup",
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Axum middleware to redirect an unauthenticated request to /login unless it matches one of the allowed paths
|
/// Axum middleware to redirect an unauthenticated request to /login unless it matches one of the allowed paths
|
||||||
|
|||||||
Reference in New Issue
Block a user