File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22class SessionsController < Devise ::SessionsController
33 include RedirectWithAuthentication
44
5- prepend_before_action :set_return_to , only : %i[ new create ]
5+ prepend_before_action :set_return_to , only : [ : new]
66
77 def new
8- respond_to { |format | format . html { redirect_with_authentication ( ' signIn' ) } }
8+ respond_to { |format | format . html { redirect_with_authentication ( " signIn" ) } }
99 end
1010
1111 private
Original file line number Diff line number Diff line change @@ -13,16 +13,7 @@ def id
1313 orm :active_record
1414
1515 # This block will be called to check whether the resource owner is authenticated or not.
16- resource_owner_authenticator do
17- if user_signed_in?
18- current_user
19- else
20- # Redirect to login page, preserving the OAuth parameters
21- session [ :user_return_to ] = request . fullpath
22- redirect_to new_user_session_url
23- nil
24- end
25- end
16+ resource_owner_authenticator { user_signed_in? ? current_user : NullResourceOwner . new }
2617
2718 # If you didn't skip applications controller from Doorkeeper routes in your application routes.rb
2819 # file then you need to declare this block in order to restrict access to the web interface for
You can’t perform that action at this time.
0 commit comments