Giter Site home page Giter Site logo

Comments (6)

riverrun avatar riverrun commented on June 2, 2024 2

Just added token_module as an option. It's available in version 2.3.0.

There are examples of how to use it in the authenticate/token_test.exs, confirm/base_test.exs and remember_test.exs test files.

Closing this issue now. If you have any questions / comments, just let me know.

from phauxth.

riverrun avatar riverrun commented on June 2, 2024

Which options are you trying to configure?

from phauxth.

iacobson avatar iacobson commented on June 2, 2024

Configuring the user_context and the token_module as in the example: https://github.com/riverrun/phauxth-example/blob/master/config/config.exs#L21 would result in something like this

# umbrella_app_1 config
config :phauxth,
  user_context: UmbrellaApp1.Accounts,
  token_module: UmbrellaApp1.Auth.Token

# umbrella_app_2 config
config :phauxth,
  user_context: UmbrellaApp2.Accounts,
  token_module: UmbrellaApp2.Auth.Token

Those config options will get overwritten in the umbrella.

from phauxth.

riverrun avatar riverrun commented on June 2, 2024

The user_context can already be set as an option (keyword argument) for authenticate, login and confirm.

As for the token_module, do you want to use different token modules for the different apps? I can add this - I just want to clarify what you want.

from phauxth.

iacobson avatar iacobson commented on June 2, 2024

For point 1, I was not aware of the user_context option.
So having something like this
plug Phauxth.Authenticate, user_context: UmbrellaApp1.Accounts
in the router works perfectly!

For point 2, yes, that would be the idea. Having different token modules for different apps. It would be great if you add the option to the library.

Thanks so much! Not sure if I should close the ticket or leave it open for this new feature. So I will leave the decision to you.

from phauxth.

riverrun avatar riverrun commented on June 2, 2024

Adding token_module as an option should be fairly straightforward. I will get back to you soon.

from phauxth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.