module Users class OmniauthCallbacksController < Devise::OmniauthCallbacksController def all auth = request.env["omniauth.auth"] user = User.find_or_create_by(email: auth.info.email, name: auth.info.name, provider: auth.provider, uid: auth.uid) # Given colab works properly, since the user is always found or redirected, there is no chanche of an invalid user sign_in_and_redirect user end alias_method :RemoteUser, :all end end