Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate callable redirects in context of controller #203

Merged
merged 3 commits into from
Jan 26, 2024
Merged

Conversation

mikker
Copy link
Owner

@mikker mikker commented Jan 26, 2024

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, …

@mikker mikker self-assigned this Jan 26, 2024
@mikker mikker merged commit d69f28b into master Jan 26, 2024
4 checks passed
@mikker mikker deleted the eval-callables branch January 26, 2024 13:39
schpet added a commit to TanookiLabs/passwordless that referenced this pull request Apr 16, 2024
* origin/master:
  Update changelog
  Use flash.alert (mikker#215)
  Update changelog
  Add support for scoped routes (mikker#209)
  Add "token" on show page to locale definition (mikker#214)
  v1.5.0
  Update changelog
  Include TestHelpers in ActionDispatch::IntegrationTest (mikker#211)
  Add url_options param to sign_in email (mikker#208)
  Evaluate callable redirects in context of controller (mikker#203)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant