Umbrella heroku, throwing 403's

Damn, I’m pulling my hair out :wink:

I have a umbrella phx 1.3 ready to deploy to prod, at least thats what I thought. :wink:

I created a proxy app, which is calling the specific Endpoint’s of the umbrella apps.
Based on this example, https://github.com/wojtekmach/acme_bank

In dev everything works and managed to deploy to Heroku, run the migrations, run the seed and the app starts, yay!

But when I try to signin, it always throws a 403, I thought ah it’s in :secret_key_base of the prod.esx in the umbrella apps maybe there’s a difference, but they are all the same

-> secret_key_base: System.get_env(“SECRET_KEY_BASE”)

I’f checked with heroku run iex -S mix, the seeded records are there.

And i set the secret for my heroku app
heroku config:set SECRET_KEY_BASE=whyisthisdamnthingnotworking

have you set the SECRET_KEY_BASE env variable after or before you pushed your code to Heroku?

I think this gets compiled in. So when you only restart the app (Heroku does it on it’s own after setting env variable), it won’t be picked up. This is different from Rails where it’d pick it up immediately.

So, I think if you did that after pushing code, you need to make some code change and push it again to trigger recompile.

i’f double checked, but it’s there before pushing.
I also double-checked with heroku run iex -S mix -> System.get_env(“SECRET_KEY_BASE”)

there is a plug proxy in front of all the apps, maybe there is the problem?

found it, after a day hair pulling. :slight_smile:
in endpoint.ex was the dev domein specified in plug Plug.Session

:beers:

2 Likes