feat: implement admin login page
This commit is contained in:
1 parent
838ae8ba0f
commit
b422e43288
3 files changed
+16
-11
No files matched your search
@@ -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 />
|
||||
|
||||
@@ -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()} }
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user