feat: implement admin login page

This commit is contained in:
alphafetus committed 2026-03-02 16:16:15 -05:00
1 parent 838ae8ba0f
commit b422e43288
3 files changed
+16 -11

No files matched your search

+1
View File
@@ -116,6 +116,7 @@ fn LoanerRoutes() -> impl MatchNestedRoutes + Clone {
fn AdminRoutes() -> impl MatchNestedRoutes + Clone {
view! {
<ParentRoute path=path!("admin") view=AdminShell>
<Route path=path!("callback") view=AuthCallbackPage />
<Route path=path!("home") view=AdminHomePage />
<Route path=path!("providers") view=AdminProviderPage />
<Route path=path!("scholarships") view=AdminScholarshipPage />
+6 -8
View File
@@ -1,15 +1,13 @@
use leptos::prelude::*;
use crate::components::login::setup::provide_auth_context;
use crate::components::login::setup::provide_auth_context;
use leptos::prelude::*;
#[component]
pub fn AdminLoginContext(
children: Children
) -> impl IntoView {
pub fn AdminLoginContext(children: Children) -> impl IntoView {
provide_auth_context(
crate::utils::use_origin(),
"https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Lfjuy5zaM",
"56c2bqvl021rv8d5mq36blt7jv",
"/providers/callback"
"https://cognito-idp.us-east-1.amazonaws.com/us-east-1_rvCU4Xy4j",
"1vh1q994rid6cgi6tjf58r9jp4",
"/admin/callback",
);
view! { {children()} }
+9 -3
View File
@@ -1,7 +1,9 @@
use leptos::prelude::*;
use crate::common::TabInfo;
use crate::components::{Banner, TabSidebarList};
use crate::common::TabInfo;
use crate::components::login::AdminLoginContext;
use crate::components::{Banner, Loading, TabSidebarList};
use crate::pages::UnauthenticatedPage;
use leptos::prelude::*;
use leptos_oidc::{AuthLoaded, Authenticated};
/// # Admin Shell Component
///
@@ -13,6 +15,8 @@ pub fn AdminShell() -> impl IntoView {
view! {
<AdminLoginContext>
<Banner title="R15 Scholarships Admin" logo="/PHS_Stacked_Acronym.png" />
<AuthLoaded fallback=Loading>
<Authenticated unauthenticated=UnauthenticatedPage>
// We'll put the tabs here.
<TabSidebarList
base_path="admin"
@@ -23,6 +27,8 @@ pub fn AdminShell() -> impl IntoView {
TabInfo::new("Utilities", "utilities", None),
]
/>
</Authenticated>
</AuthLoaded>
</AdminLoginContext>
}
}