Redirect from sign in pages when already signed in #233
Closed
StevenClontz
started this conversation in
General
Replies: 3 comments 1 reply
-
You could do with a |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks! I ended up going this route: # config/routes.rb
passwordless_for :users, controller: "sessions" # app/controllers/sessions_controller.rb
class SessionsController < Passwordless::SessionsController
before_action :require_unauth!, only: %i[ new show ]
private
def require_unauth!
unless @current_user.nil?
redirect_to "/", notice: "You are already signed in."
end
end
end |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a slick way I can redirect from
/users/sign_in
to/
(or wherever) when the user is already authenticated?Beta Was this translation helpful? Give feedback.
All reactions