Pow: Robust, modular, extendable user authentication and management system

authentication
authorization
user_system
phoenix
pow

#62

@danschultzer Would Pow play well with multi-tenancy via Triplex in an Umbrella app? Just putting these terms together is giving me a headache :joy:

I can see that the setup for an Umbrella app is fairly similar except that the Ecto installation is done in a Repo app (assuming your Umbrella app is configured that way). But would setting the tenant dynamically have any impact on Pows config? Any gotchas I should be aware of?


#63

Yeah, I think a custom reset password controller will be the easiest to work with in this case.

I had to read up a bit on this, since I’m not familiar with Triplex or have built multi-tenant apps. You can feed the configuration dynamically so you should be able to go most of the way. Maybe it just requires that repo opts can be propagated from the config.

If you don’t mind, then I would love to discuss this in an issue on github and come up with a solution for what you need. This is definitely a good use case for Pow.


#64

I’ve opened an issue with proposed solution for multi-tenant apps: https://github.com/danschultzer/pow/issues/139


#65

Thanks. I was meaning to do it today, but you beat me to it.


#66

@danschultzer - thanks for writing Pow. I have been thinking of using Pow going forward instead of my hand rolled user auth setup, and have some extensions in mind already.

When playing with Pow this morning on a fresh umbrella app, I found the current umbrella instructions just a little confusing for the configuration:

  • Use :my_app_web instead of :my_app

I dont believe that phx creates a :my_app_web application anywhere, umbrella or not??

Anyway I documented all the steps of creating a basic umbrella app for use with Pow and pushed up an example repo. Feel free to rip walkthrough the instructions out of the README and add to the Pow repo if you wish.


#67

It does. In the apps/myapp_web directory the OTP app is :myapp_web and not :myapp.


#68

An aside, would that name space apply to APIs? I mean, would you have an api_web, or would the preferred convention be api only?


#69

Ohh I gotcha. It is referring to whatever the otp name is of the Phoenix umbrella child app you want to configure - @abitdodgy which can be any name you choose.

Thanks for clearing that up.

Side note if you did create an Phoenix umbrella child app named my_app_web you would end up with a confusing automated folder structure of:

/apps/my_app_web/lib/my_app_web
/apps/my_app_web/lib/my_app_web_web

Naming things is hard.


#70

Yep ^^

What I did is to just name it my_app but I knew the essential code will reside in my_app_web.


#71

The assumption was that the mix phx.new --umbrella task was used to create the umbrella phoenix app. I’ve updated the guide to clarify this. You are correct that it’s not true if you are setting it up the apps individually. Thanks!

If you’re using Phoenix, then it would most likely still be _web, but that’s only because of how the Phoenix generators sets up the apps.