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
Don't automatically cast all env-vars to numbers #9521
Comments
Odd! I just copy pasted your example (including the Could there be a discrepancy in how those env vars are loaded into Docker? One thing I noticed is that the env vars don't use quotes, except for the AUTH ones, maybe that doesn't fly with Docker's way of loading in the .env file? |
(@danilopolani this is exactly the sort of config gotcha that prevents us from doing cool things like in your PR 😄 ) |
Took me a good 30 min but I got it: Well what happens is that here directus thinks it's a number because of the So I don't know how much numbers are required in the config file, so can't tell if this is a required feature, however makes oauth/openid not usable with slack. |
Yeah, it's the same for Facebook Client ID. |
You should be able to force cast it to a string by using We'll leave this open, as I agree we should probably not cast things to numbers by default, and instead rely on a hardcoded list of env vars that we expect to be numbers 👍🏻 |
client_id
Can confirm that with `"string:..." it works. Maybe a small "watch out" section in the docs would be helpfull :) |
Linear: ENG-287 |
I just ran into this issue with facebook OAuth login. They use all numbers for their CLIENT_ID which was giving me an error:
I'm using Directus 10.3.0 |
Preflight Checklist
Describe the Bug
I'm trying to get openid to work but no luck.
I've tested the OpenID flow with https://openidconnect.net/ and it works.
What is interesting, looking at the code
It should be an error before if
clientId
would not be defined hereHowever the error comes from the
openid-client
library.Am I missing something?
Thanks & I hope it's not a duplicate, could not find anything
To Reproduce
Get the latest release
v9.0.0
and try slack oauth or openidErrors Shown
Stacktrace:
What version of Directus are you using?
v9.0.0
What version of Node.js are you using?
The one in the official docker image
What database are you using?
postgres:14-alpine
What browser are you using?
FF
What operating system are you using?
macOS
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: