Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run dev:oidc broken #1034

Closed
alxndrsn opened this issue Oct 15, 2024 · 4 comments
Closed

npm run dev:oidc broken #1034

alxndrsn opened this issue Oct 15, 2024 · 4 comments

Comments

@alxndrsn
Copy link
Contributor

It looks like npm run dev:oidc no longer serves frontend with OIDC enabled:

Screenshot_2024-10-15_12-19-35

Possibly affected by 9236c61

@alxndrsn
Copy link
Contributor Author

Temporary fix:

--- a/main.nginx.conf
+++ b/main.nginx.conf
@@ -96,7 +96,7 @@ http {
 
     location = /client-config.json {
       include ./common-headers.nginx.conf;
-      return 200 "{}";
+      return 200 "{ \"oidcEnabled\": \"true\" }";
     }
 
     location / {

alxndrsn pushed a commit to alxndrsn/odk-central-frontend that referenced this issue Oct 15, 2024
* generate public/client-config.js at foreman startup
* remove nginx's special handling for client-config.js

Closes getodk#1034
@matthew-white
Copy link
Member

Hmm I'm actually having trouble reproducing this. npm run dev:oidc is working on my machine and shows the OIDC login page.

Possibly affected by 9236c61

My intention at least was to keep npm run dev:oidc working when I made that change. You can see that VUE_APP_OIDC_ENABLED is still referenced in src/config.js. src/config.js specifies the defaults for the client config, which are then merged with the response from /client-config.json (which is {} in dev).


Could it be that the environment variable isn't getting passed through for some reason? Could you try console.log(process.env.VUE_APP_OIDC_ENABLED) ?

@matthew-white
Copy link
Member

I've actually been having the thought that now that Frontend requests /client-config.json, we might be able to take a more flexible approach than what we currently do with npm run dev:oidc. I'm thinking that instead of running npm run dev:oidc, you could run the normal npm run dev, but modify a local client-config.json file to specify { "oidcEnabled": true }. The local client-config.json is intended to work sort of like an .env file, where options are passed in, but don't show up in version control. Let me know if you think that approach might be useful: #1038.

@alxndrsn
Copy link
Contributor Author

Hmm I'm actually having trouble reproducing this. npm run dev:oidc is working on my machine and shows the OIDC login page.

It's working for me now too 🤔 I guess I was mistaken, or perhaps there was a caching issue. Either way, this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants