diff --git a/astro.config.mjs b/astro.config.mjs index 8f74173..b08b435 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -15,9 +15,31 @@ import icon from "astro-icon"; // https://astro.build/config export default defineConfig({ + output: "server", integrations: [tailwind(), expressiveCode(), react(), icon(), mdx()], adapter: node({ mode: "standalone", }), + + // Define environment variables that should be available to client components + vite: { + define: { + "import.meta.env.PUBLIC_LOGTO_APP_ID": JSON.stringify( + process.env.PUBLIC_LOGTO_APP_ID, + ), + "import.meta.env.PUBLIC_LOGTO_APP_SECRET": JSON.stringify( + process.env.PUBLIC_LOGTO_APP_SECRET, + ), + "import.meta.env.PUBLIC_LOGTO_ENDPOINT": JSON.stringify( + process.env.PUBLIC_LOGTO_ENDPOINT, + ), + "import.meta.env.PUBLIC_LOGTO_TOKEN_ENDPOINT": JSON.stringify( + process.env.PUBLIC_LOGTO_TOKEN_ENDPOINT, + ), + "import.meta.env.PUBLIC_LOGTO_API_ENDPOINT": JSON.stringify( + process.env.PUBLIC_LOGTO_API_ENDPOINT, + ), + }, + }, }); diff --git a/bun.lock b/bun.lock index 7b10398..d9b694c 100644 --- a/bun.lock +++ b/bun.lock @@ -17,6 +17,7 @@ "astro": "5.1.1", "astro-expressive-code": "^0.40.2", "astro-icon": "^1.1.5", + "axios": "^1.8.2", "chart.js": "^4.4.7", "dexie": "^4.0.11", "framer-motion": "^12.4.4", @@ -437,7 +438,7 @@ "autoprefixer": ["autoprefixer@10.4.20", "", { "dependencies": { "browserslist": "^4.23.3", "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g=="], - "axios": ["axios@1.7.9", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw=="], + "axios": ["axios@1.8.2", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg=="], "axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="], @@ -1427,6 +1428,8 @@ "@expressive-code/plugin-shiki/shiki": ["shiki@1.29.2", "", { "dependencies": { "@shikijs/core": "1.29.2", "@shikijs/engine-javascript": "1.29.2", "@shikijs/engine-oniguruma": "1.29.2", "@shikijs/langs": "1.29.2", "@shikijs/themes": "1.29.2", "@shikijs/types": "1.29.2", "@shikijs/vscode-textmate": "^10.0.1", "@types/hast": "^3.0.4" } }, "sha512-njXuliz/cP+67jU2hukkxCNuH1yUi4QfdZZY+sMr5PPrIyXSu5iTb/qYC4BiWWB0vZ+7TbdvYUCeL23zpwCfbg=="], + "@iconify/tools/axios": ["axios@1.7.9", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw=="], + "@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], "@isaacs/cliui/wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="], diff --git a/package.json b/package.json index 22baf45..cd61df5 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "astro": "5.1.1", "astro-expressive-code": "^0.40.2", "astro-icon": "^1.1.5", + "axios": "^1.8.2", "chart.js": "^4.4.7", "dexie": "^4.0.11", "framer-motion": "^12.4.4", diff --git a/src/components/dashboard/SettingsSection.astro b/src/components/dashboard/SettingsSection.astro index 4eb9d97..a6770ec 100644 --- a/src/components/dashboard/SettingsSection.astro +++ b/src/components/dashboard/SettingsSection.astro @@ -5,120 +5,201 @@ import AccountSecuritySettings from "./SettingsSection/AccountSecuritySettings"; import NotificationSettings from "./SettingsSection/NotificationSettings"; import DisplaySettings from "./SettingsSection/DisplaySettings"; import ResumeSettings from "./SettingsSection/ResumeSettings"; + +// Import environment variables +const logtoAppId = import.meta.env.LOGTO_APP_ID; +const logtoAppSecret = import.meta.env.LOGTO_APP_SECRET; +const logtoEndpoint = import.meta.env.LOGTO_ENDPOINT; +const logtoTokenEndpoint = import.meta.env.LOGTO_TOKEN_ENDPOINT; +const logtoApiEndpoint = import.meta.env.LOGTO_API_ENDPOINT; + +// Log environment variables for debugging +console.log("Environment variables in Astro file:"); +console.log("LOGTO_APP_ID:", logtoAppId); +console.log("LOGTO_APP_SECRET:", logtoAppSecret); +console.log("LOGTO_ENDPOINT:", logtoEndpoint); +console.log("LOGTO_TOKEN_ENDPOINT:", logtoTokenEndpoint); +console.log("LOGTO_API_ENDPOINT:", logtoApiEndpoint); + +// Define fallback values if environment variables are not set +const safeLogtoAppId = logtoAppId || "missing_app_id"; +const safeLogtoAppSecret = logtoAppSecret || "missing_app_secret"; +const safeLogtoEndpoint = logtoEndpoint || "https://auth.ieeeucsd.org"; +const safeLogtoTokenEndpoint = + logtoTokenEndpoint || "https://auth.ieeeucsd.org/oidc/token"; +const safeLogtoApiEndpoint = logtoApiEndpoint || "https://auth.ieeeucsd.org"; ---
Manage your account settings and preferences
-Manage your account settings and preferences
++ This section is only visible in development mode +
+Variable | +Value | +Status | +
---|---|---|
LOGTO_APP_ID | +{logtoAppId ? "********" : "Not set"} | +{logtoAppId ? "✅" : "❌"} | +
LOGTO_APP_SECRET | +{logtoAppSecret ? "********" : "Not set"} | +{logtoAppSecret ? "✅" : "❌"} | +
LOGTO_ENDPOINT | +{logtoEndpoint || "Not set"} | +{logtoEndpoint ? "✅" : "❌"} | +
LOGTO_TOKEN_ENDPOINT | +{logtoTokenEndpoint || "Not set"} | +{logtoTokenEndpoint ? "✅" : "❌"} | +
LOGTO_API_ENDPOINT | +{logtoApiEndpoint || "Not set"} | +{logtoApiEndpoint ? "✅" : "❌"} | +
+ Update your personal information and profile details +
+ ++ Upload and manage your resume for recruiters and career opportunities +
+ ++ Manage your account security settings and authentication options +
+ +- Update your personal information and profile details -
- -+ Notification settings will be available in a future update +
+- Upload and manage your resume for recruiters and career - opportunities -
- -+ Customize how and when you receive notifications +
+ +- Manage your account security settings and authentication options -
- -- Notification settings will be available in a future update -
-- Customize how and when you receive notifications -
- -- Customize your dashboard appearance and display preferences -
- -+ Customize your dashboard appearance and display preferences +
+ ++ Update your account password. For security reasons, you'll need to provide your current password. +
+- To change your password, please use the "Forgot Password" option on the login page. -
Using fixed LogTo implementation with {useFormSubmission ? 'form submission' : 'JSON'}
+Logto User ID: {logtoUserId || 'Not found'}
+Debug Info:
+{JSON.stringify(debugInfo, null, 2)}+