Skip to content

Commit

Permalink
feat(google auth): remember the user (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreybakanovsky authored Oct 25, 2023
1 parent 9ab6726 commit b8a94c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/users/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

module Users
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
include Devise::Controllers::Rememberable

def google_oauth2
remember_me user
sign_in_and_redirect user, event: :authentication
end

private

def user
memoize def user
OmniauthAuthenticateAction.new(access_token: request.env['omniauth.auth']).perform
end
end
Expand Down

0 comments on commit b8a94c3

Please sign in to comment.