NullOranje
I’m working on an application that uses Pow for user authentication. One of the features I need to implement is to invite users, but this is done by a non-interactive process. Users will still verify themselves via the same process. I’m a bit lost in the documentation, but from what I see, I can use PowInvitation.Ecto.Context to create a new user changeset, but the logic of inserting that into the database and sending the invitation would be left for me to implement.
Two questions:
- Is this a case where it makes more sense to write the entire Invitation process myself?
- If I do write the backend, how do I prevent the Phoenix router from exposing the [:new, :create, :show] routes? My understanding is that these would be automagically exposed via pow_extension_routes()
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
Plotto is a 100% Elixir charting library with no NIFs or external dependencies. In this episode, we’ll use it to add interactive SVG char...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Marked As Solved- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
danschultzer
You can exclude
PowInvitationin thePow.Extension.Phoenix.Routermacro opts and add in the routes manually:To create the invited user:
To send out the invitation email you need this:
PowInvitationexpects aninvited_byassoc which is the user that initiated the invitation. You can make a custominvite_changeset/3to ignore it.Also Liked
danschultzer
Set up a partial template in Phoenix, and use that in both:
MyNameIsURL
Hey Dan,
I followed your steps to create a custom invite and called
PowInvitation.Ecto.Context.create(invited_by, params, config)like you suggested, then passed the user to thedeliver_emailfunction like you suggested. Butuser.invitation_tokenis the unsigned UUID. So the emails were going out with a link like/invitations/b2a4a605-29e3-41a3-b114-89231db3da0e/edit.So I modified your
deliver_emailfunction you posted like so. Is calling ThePowInvitation.Plug.sign_invitationfunction the best way to generate the signed token for the email. Or is there a higher level function I should be calling to sign the token and generate the user at the same time. Here is my solution below:danschultzer
If you’ve set the
:web_modulein the Pow config, then the extensions will also use custom templates. The PowInvitation templates are generated withmix pow.extension.phoenix.gen.templates --extension PowInvitation, and you should have seen an error if they where not generated visiting the invitation endpoints. The templates will be intemplates/pow_invitation.Last Post!
joe
I needed to display the invitation link in the app for admin users. This here worked perfectly. Thank you.