Skip to content

request.env['omniauth.auth'] is nil in Omniauth Callback #1057

Open
@alec-c4

Description

@alec-c4

Configuration

  • Provider Gem: omniauth-google-oauth2, omniauth-facebook, omniauth-vkontakte
  • Ruby Version: 3.0.2
  • Framework: ruby on rails 6.1.4.1
  • Platform: macOS

Expected Behavior

It should allow to login using Google, Facebook, and Vk

Actual Behavior

Exception NoMethodError undefined method `provider' for nil:NilClass and request.env['omniauth.auth'] is nil in OmniauthCallbackController

Steps to Reproduce

Create app from any rails template https://github.com/alec-c4/kickstart for example

rails new test_application --no-skip-hotwire -T -c bootstrap -j esbuild -d postgresql -m https://raw.githubusercontent.com/alec-c4/ks-rails-bootstrap/master/template.rb

add creadentials

active_record_encryption:
  primary_key: ''
  deterministic_key: ''
  key_derivation_salt: ''
secret_key_base: ''
devise:
  secret_key: ''
google:
  client_id: ''
  client_secret: ''
postmark:
  api_key: ''

and try to login using Google

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions