You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActionDispatch::Cookies::CookieOverflow in Users::OmniauthCallbacksController#google_oauth2
Line: session["devise.google_oauth2_data"] = request.env["omniauth.auth"].except(:extra) # Removing extra as it can overflow some session stores
Controller:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
# See https://github.com/omniauth/omniauth/wiki/FAQ#rails-session-is-clobbered-after-callback-on-developer-strategy
skip_before_action :verify_authenticity_token, only: :google_oauth2
def google_oauth2
@user = User.from_omniauth(request.env["omniauth.auth"])
if @user.persisted?
sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated
set_flash_message(:notice, :success, kind: "Google") if is_navigational_format?
else
session["devise.google_oauth2_data"] = request.env["omniauth.auth"].except(:extra) # Removing extra as it can overflow some session stores
redirect_to new_user_registration_url
end
end
def failure
redirect_to root_path
end
end
The scope for google inside the devise config file: scope: 'userinfo.email,userinfo.profile'
The text was updated successfully, but these errors were encountered:
Configuration
omniauth-google_oauth2
3.0.0
Ruby on Rails 6.1.2.1
MacOs
Actual Behavior
ActionDispatch::Cookies::CookieOverflow in Users::OmniauthCallbacksController#google_oauth2
Line:
session["devise.google_oauth2_data"] = request.env["omniauth.auth"].except(:extra) # Removing extra as it can overflow some session stores
Controller:
The scope for google inside the devise config file:
scope: 'userinfo.email,userinfo.profile'
The text was updated successfully, but these errors were encountered: