Some checks failed
Introduce a marketing landing page at `/` with hero section, feature grid, how-it-works steps, CTA banner, and footer. Move the authenticated dashboard to `/dashboard`. Add static Impressum and Privacy Policy pages for EU legal compliance. Update login redirect defaults accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
889 B
Rust
31 lines
889 B
Rust
use crate::Route;
|
|
use dioxus::prelude::*;
|
|
|
|
/// Login redirect component.
|
|
///
|
|
/// Redirects the user to the external OAuth authentication endpoint.
|
|
/// If no `redirect_url` is provided, defaults to `/dashboard`.
|
|
///
|
|
/// # Arguments
|
|
///
|
|
/// * `redirect_url` - URL to redirect to after successful authentication
|
|
#[component]
|
|
pub fn Login(redirect_url: String) -> Element {
|
|
let navigator = use_navigator();
|
|
|
|
use_effect(move || {
|
|
// Default to /dashboard when redirect_url is empty.
|
|
let destination = if redirect_url.is_empty() {
|
|
"/dashboard".to_string()
|
|
} else {
|
|
redirect_url.clone()
|
|
};
|
|
let target = format!("/auth?redirect_url={destination}");
|
|
navigator.push(NavigationTarget::<Route>::External(target));
|
|
});
|
|
|
|
rsx!(
|
|
div { class: "text-center p-6", "Redirecting to secure login page…" }
|
|
)
|
|
}
|