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
already_authenticated
should set flash notice
instead of flash alert
#5302
Comments
I think it would be neat to have an option to skip showing the message entirely, because for me this doesn't add that much to the UX (most users probably wouldn't care if they're already signed in, but just want to use the app). Equally open to submitting a quick PR to enable this |
@johansenja that makes a lot of sense to me. This alert is very odd. |
I have introduced PR #5398 to change the flash message from 'alert' to 'notice'. Do you think this is the best way to do this? Should the flash level be configurable instead of hard-coded? Your feedback is requested. |
@johansenja I agree it doesn't add much to the UI. Failing silently would be a good option. It seems like adding an option for this would be pretty heavy, since it would require:
Maybe there is an easier way? Looking at the devise/app/controllers/devise_controller.rb Lines 154 to 161 in c82e4cf
However in my very quick experiment doing this resulted in a "translation missing" error. Do you think it's still worth adding a config option for this? |
devise/app/controllers/devise_controller.rb
Lines 114 to 117 in 83a32e6
This sets the
flash[:alert]
, which in most apps is an error message. This is also evidenced by thealready_authenticated
key being set in thedevise.failure
scope.In most apps, failure or alert messages are displayed with red text indicating that something went wrong. In my opinion this feels strange, because if you're already signed in, nothing went wrong. In fact, nothing is wrong, you just tried to sign in again unnecessarily.
It seems like it would be trivial to move the
already_authenticated
message fromdevise.failure
todevise.sessions
and set the flash key tonotice
instead ofalert
.Would you be open to a change like this? If so, I can submit a PR.
The text was updated successfully, but these errors were encountered: