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

Set a custom controller for passwordless_for routes. #152

Merged
merged 4 commits into from
Jul 15, 2023

Conversation

henrikbjorn
Copy link
Contributor

Closer to using multiple models in the same project. E.g providing Devise like support for ActiveAdmin but with Passwordless

module Admin
  class SessionsController < Passwordless::SessionsController
    layout 'admin'
  end
end
passwordless_for :users
passwordless_for :admin_users, controller: 'admin/sessions'

@mikker
Copy link
Owner

mikker commented Jun 19, 2023

I appreciate the effort!

I feel like if you're already using your own custom controller, you may as well set up your own routes too. It's only 4 lines that are easily copied.

I don't want to have to support an option like this at this point.

@henrikbjorn
Copy link
Contributor Author

I appreciate the effort!

I feel like if you're already using your own custom controller, you may as well set up your own routes too. It's only 4 lines that are easily copied.

I don't want to have to support an option like this at this point.

It seems like a natural extension point instead of copy pasting the helper method, and making sure that the authenticable default params etc. are present.

Previously I defaulted to do something like this:

Rails.configuration.to_prepare do
  Passwordless::SessionsController.class_eval do
    layout 'passwordless'
  end
end

Also before I make another PR. I would like to use a custom mailer and thought about adding Passwordless.mailer just like devise does.

@mikker mikker merged commit 0d3bca6 into mikker:master Jul 15, 2023
6 checks passed
@mikker
Copy link
Owner

mikker commented Jul 15, 2023

Change of heart. This is good! Thank you @henrikbjorn for contributing and for sticking to it.
❤️🧡💛💚💙💜

@henrikbjorn henrikbjorn deleted the custom-controller branch July 19, 2023 08:39
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

2 participants