mikker / passwordless

🗝 Authentication for your Rails app without the icky-ness of passwords
MIT License
1.27k stars 88 forks source link

Evaluate callable redirects in context of controller #203

Closed mikker closed 8 months ago

mikker commented 8 months ago

Getting a little fancy here, perhaps too much, but I wanted something like this to work:

Passwordless.configure do |config|
  config.success_redirect_path = -> (user) do
    user.creator? ? creators_path : members_path
  end
end

Of course, I could've made a dedicated "landing action" that handled this instead. But, …