From 3533dc8048b3b56d3ec86ad579820aed83eee18b Mon Sep 17 00:00:00 2001 From: chark1es Date: Sat, 5 Apr 2025 03:24:10 -0700 Subject: [PATCH] redefined logout fix --- src/pages/api/logout.ts | 3 + src/pages/dashboard.astro | 1834 ++++++++++++++++--------------- src/pages/oauth2-redirect.astro | 34 +- 3 files changed, 1002 insertions(+), 869 deletions(-) diff --git a/src/pages/api/logout.ts b/src/pages/api/logout.ts index 44c00de..f3880b2 100644 --- a/src/pages/api/logout.ts +++ b/src/pages/api/logout.ts @@ -32,6 +32,9 @@ export const GET: APIRoute = async ({ request, redirect }) => { // Make a POST request to the Logto session end endpoint with the redirect in the body const logoutUrl = `${logtoEndpoint}/oidc/session/end`; + + console.log(`Using Logto endpoint: ${logtoEndpoint}`); + console.log(`Full logout URL: ${logoutUrl}`); try { // Try to make a POST request with the redirect in the body and client ID diff --git a/src/pages/dashboard.astro b/src/pages/dashboard.astro index cbc1dba..ebe7ff6 100644 --- a/src/pages/dashboard.astro +++ b/src/pages/dashboard.astro @@ -23,17 +23,17 @@ const dashboardConfig = yaml.load(fs.readFileSync(configPath, "utf8")) as any; // Dynamically import all dashboard components const components = Object.fromEntries( - await Promise.all( - Object.values(dashboardConfig.sections) - .filter((section: any) => section.component) // Only process sections with components - .map(async (section: any) => { - const component = await import( - `../components/dashboard/${section.component}.astro` - ); - // console.log(`Loaded component: ${section.component}`); // Debug log - return [section.component, component.default]; - }), - ), + await Promise.all( + Object.values(dashboardConfig.sections) + .filter((section: any) => section.component) // Only process sections with components + .map(async (section: any) => { + const component = await import( + `../components/dashboard/${section.component}.astro` + ); + // console.log(`Loaded component: ${section.component}`); // Debug log + return [section.component, component.default]; + }) + ) ); // console.log("Available components:", Object.keys(components)); // Debug log @@ -41,426 +41,515 @@ const components = Object.fromEntries( - - - - {title} | IEEE UCSD - - - - - - + + + + {title} | IEEE UCSD + + + + + + -
- - - - -
- -
-
-
- -

IEEE UCSD

-
-
-
- - -
- -
-
-
-

Loading dashboard...

-
-
- - - - - - - - -
- { - Object.entries(dashboardConfig.sections).map( - ([sectionKey, section]: [string, any]) => { - // Skip if no component is defined - if (!section.component) return null; - - const Component = components[section.component]; - return ( - + + +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + +
+ + + + + + +
+ +
+
+
+ +

IEEE UCSD

+
+
+
+ + +
+ +
+
+
+
+

Loading dashboard...

+
+
+ + + + + + + + +
+ { + Object.entries(dashboardConfig.sections).map( + ([sectionKey, section]: [string, any]) => { + // Skip if no component is defined + if (!section.component) return null; + + const Component = + components[section.component]; + return ( + + ); + } + ) + } +
+
+
-
-
- - + + - - + + diff --git a/src/pages/oauth2-redirect.astro b/src/pages/oauth2-redirect.astro index b2c72ef..f2ba918 100644 --- a/src/pages/oauth2-redirect.astro +++ b/src/pages/oauth2-redirect.astro @@ -3,15 +3,25 @@ import Layout from "../layouts/Layout.astro"; const title = "Authenticating..."; --- -
-
-

Redirecting to dashboard...

-
-
-
-
-
- + + + + + {title} | IEEE UCSD + + + +
+
+

Redirecting to dashboard...

+
+
+
+
+
+ + +