riverrun / openmaize

No longer maintained - was an Authentication library for Plug-based applications in Elixir
Other
206 stars 30 forks source link

create both api auth for api's & session auth for html site #97

Closed rrevanth closed 5 years ago

rrevanth commented 7 years ago

Currently the --api command will only create api authentication whereas without it would be used in html site authentication.

Is there a way to create both api authentication files as well as auth for using in site!

riverrun commented 7 years ago

If you could show me an example of what you want to see, then I can probably help you more.

rrevanth commented 7 years ago

I am trying to create a phoenix app with both api routes and web app routes.

like for a post resource . I will have

/api/posts/(new|edit|show|index) /posts/(new|edit|show|index)

routes and would like to authenticate both api and web routes.

Is it possible to use openmaize for both routes at the same time

riverrun commented 7 years ago

I'll look into it.

rrevanth commented 7 years ago

Thank you! :)

riverrun commented 7 years ago

Sorry this has taken so long, but I've been really busy. It was wondering how you could do this with the Phoenix generators, but it seems like they don't accommodate this situation. One problem I see is how you are going to organize the different view and controller files. Could you give me more information about how you would do this? Maybe it would be a good idea to ask a question on elixirforum.com about how other people organize their apps with both html and api routes.

rrevanth commented 7 years ago

No worries. I for one am will use generators to get the basic template and move the api controllers,views and everything to api in their respective folders with proper namespacing like

/controllers - html /api/controllers - api /views - html /api/views - api

like this.

If it's an umbrella, we can have api as a entirely separate app and core as another which both depends on

umbrella/

But I also thing elixirforum is best place to ask this :

There is already a question about umbrella there 👍 😄

riverrun commented 5 years ago

Closing as development has moved to phauxth.