Replies: 1 comment
-
Sorry you encountered problems but thanks for taking the time to write all that up and share your experiences! No detectable hint of anger either... you must meditate! 😄
Not to point the finger, but are we sure the OmniAuth setup doesn't have quirks with multiple
does it raise the same OmniAuth error? I would be surprised if our gem was involved in the problem as we don't have any special routing logic beyond adding a helper method 🤔
Hmm, the URL helper should work in this scenario. If you look in our integration test suite, we use namespaced routes a lot with no problems: https://github.com/abevoelker/devise-passwordless/blob/6e3c26dff8924ee9050f3b4d6fa312ece39669e4/spec/dummy_app_config/shared_source/all/config/routes.rb The routing workarounds in problems 2 and 3 definitely shouldn't be necessary, I'm not sure what exactly is going on with the routing but something is strange. Would you be comfortable sharing a stripped-down version of your app that I could take a look at more in-depth some time? We definitely want to get this working way more cleanly than what you've had to do! |
Beta Was this translation helpful? Give feedback.
-
Hey :)
While trying to combine password and passwordless auth in the same model in my current setup I hit some roadblocks. Since there's not much out there about this library decided to share what the issues were and how I overcame them.
Setup
My user model enables the following strategies:
My routes:
Problem 1 - OmniAuth error
When I add the following to my routes file
I get the following error:
My solution was to skip the
:omniauth_callbacks
route creation. (Why isdevise-passwordless
trying to create routes for it?)Problem 2 - Default URL in mailer doesn't work
After this, I can create a view with a form that submits the request for a magic link to
passwordless_user_session_path
. But when I do that I getThe generated email template assumes that we are using a setup where only passwordless sign in is being used. Since we're namespacing the
devise-passwordless
routes we have to change the URL topasswordless_user_magic_link_url
Problem 3 -
Great, now I get an email with the magic link! But when I click it I get the following Routing error:
No ideia why this is happening, but adding the following to the routes file:
(Based on this blogpost)
And changing the call to the passwordless
devise_for
tosolves it.
Success
Now everything works! :)
Problem 1 and Problem 3 are mysterious and would be nice that they didn't happen. Are they due to some bug(s)? Or (more probable) due to something wrong in my setup?
Regarding, Problem 2, maybe it would be useful to add some lines in the docs about it?
Beta Was this translation helpful? Give feedback.
All reactions