AshAuthentication not working with Phoenix in umbrella
I just followed this guide https://ash-hq.org/docs/guides/ash_authentication_phoenix/latest/tutorials/getting-started-with-ash-authentication-phoenix trying to make ash authentication work.
The major difference is that I'm using an umbrella project, so the resources are in one app (Marketplace) and the web (phoenix) stuff in another app (MarketplaceWeb), but the rest is pretty much the same.
If I try to access the root route (which uses the guide minimal html) I will get a
key :current_user not found in ...
Also, if I try to directly access the sign-in page (http://localhost:4000/sign-in
), I will get a blank page with just the Ash
logo (see image).
Not sure what I'm doing wrong or if it is something related to my project being inside an umbrella project.
Any thoughts?Ash HQ
Guide: Getting Started With Ash Authentication Phoenix
Read the "Getting Started With Ash Authentication Phoenix" guide on Ash HQ

6 Replies
I think you’ll need to configure the
ash_apis
for the web app as well to include your accounts api. Although that seems less than ideal. I think ideally we’d allow that to be passed in when setting up auth routes
That may cause other issues but I don’t think so.But don't they share the same config? I mean, I placed the
ash_apis
config in the config.exs
file in the umbrella level, not inside the Marketplace
level.
I'm pretty sure the MarketplaceWeb
has access to it too 🤔
Ahh, you mean having the same config but with config :marketplace_web
instead of config :marketplace
Yep
Well.. that was it hahaha, thanks
But I agree with you, it would be nice to somehow not have to duplicate that config
Nice 🙂 you may encounter a bug somewhere down the road about those not being unique because there are some places we get all APIs for all apps
But I’ll fix if you do
Sounds good, thanks again!