pow-auth / pow_assent

Multi-provider authentication for your Pow enabled app
https://powauth.com
MIT License
321 stars 50 forks source link

Custom UserIdentities belongs_to type #197

Closed pthompson closed 3 years ago

pthompson commented 3 years ago

I am using EctoHashids to hash my user ids. EctoHashids uses custom Ecto types in its implementation. Thus I need to be able to customize the pow_assent_user_identity_fields to specify the belongs_to user type. For example, something like:

belongs_to(name, @pow_user_mod, type: EctoHashids.Types.U)

What would be the best way to do this?

pthompson commented 3 years ago

I got some help on the Elixir Slack, so we can close this.

RodolfoSilva commented 3 years ago

Hi, @pthompson how did you solve this?

benonymus commented 1 year ago

@pthompson Could you share how did you solve this?

benonymus commented 1 year ago

Found it, you can do @pow_assent_assocs [{:belongs_to, :user, :users, [type: EctoHashids.Types.U]}]