Reputation: 34934
# Gemfile
gem 'omniauth'
gem 'omniauth-google-oauth2'
gem 'devise'
# view
- if user_signed_in?
Signed in as
= current_user.oauth_name
= button_to('Sign out', destroy_user_session_path, method: :delete)
- else
= link_to('Sign in with Google', user_omniauth_authorize_path(:google_oauth2))
What's the best way to catch the moment when the user gets redirected to google for authentication?
It could be by "javascript onclick", but I want to catch the moment on the server somehow (if it's possible) because I need to save some variable to the session.
Upvotes: 0
Views: 551