Closed williamweckl closed 6 years ago
@williamweckl What is the issue of doing System.get_env("GUARDIAN_SECRET")
?
When I do it at config it will compile as a string, so if I build my application in a different environment that I run it the configuration value will be different...
Better explained at: https://hexdocs.pm/distillery/runtime-configuration.html
I didn't finish to read by so far
From the posted link
NOTE: It is no longer recommended to use the {:system, "VAR"} convention, as it has inconsitent use in the community, and instead we’d rather push people towards an approach which works every time, rather than only sometimes.
So why are you trying to use that way?
From Distillery official documentation this method is not recommended.
@yordis
Answering your question I'm using it because almost all my other libraries accepts this format, even phoenix uses it... If I can't use it at least I need a way to set it at runtime...
@williamweckl could be this what you are looking for?
secret_key: {MyModule, :function_name, [:some, :args]}
From the readme: https://github.com/ueberauth/guardian#more-advanced-secrets
@yordis yes! this will work for me! thank you!
Having this same issue, even tho the CHANGELOG says this is supported https://github.com/ueberauth/guardian/blob/master/CHANGELOG.md#v-0140
Hi guys, I'm using distillery and trying to use the convention tuple to set environment variable secret_key and noticed I can't do it.
Error I'm getting:
Stack trace:
My config at prod.exs:
If I use
System.get_env("GUARDIAN_SECRET")
it works. Using guardian1.0.1
with elixir1.6.4