lynndylanhurley / lynndylanhurley/devise_token_auth

'RuntimeError in DeviseTokenAuth::OmniauthCallbacksController#omniauth_success' with omniauth-facebook

Open
#910 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
3.6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

rails 5.0.3

gem 'devise'
gem 'devise_token_auth', :git => 'git://github.com/lynndylanhurley/devise_token_auth.git'
gem 'omniauth'
gem 'omniauth-facebook'

When I did "facebook login" with JS SDK(Client side flow), did callback below in "FB.login"

$.getJSON('/api/v1/auth/facebook/callback', function(json) {
console.log(json);
});

then I got below

'RuntimeError in DeviseTokenAuth::OmniauthCallbacksController#omniauth_success'

raised 'No resource_class found'

/devise_token_auth/omniauth_callbacks_controller.rb:109:in `resource_class'

Parameters:

{"provider"=>"facebook"}

Toggle session dump

_csrf_token: "B5dLxdaxxxxxxxxxxxxxxxxxxxxUkwxsdbV5ffLKUE2/9zStM="
flash: {"discard"=>[], "flashes"=>{"notice"=>"Signed in successfully."}}
omniauth.params: {"resource_class"=>"User"}
omniauth.state: "8ce127b72794xxxxxxxxxxxxxxxxxxxxec38501ed5d11baf"
session_id: "ca70xxxxxxxxxxxxxxxxxxxx0707d053"
warden.user.user.key: [[1], "$2a$11$fTN9xxxxxxxxxxxxxxQile"]

Toggle env dump

GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
HTTP_ACCEPT_ENCODING: "gzip, deflate, sdch, br"
HTTP_ACCEPT_LANGUAGE: "ja,en-US;q=0.8,en;q=0.6"
HTTP_CACHE_CONTROL: "max-age=0"
HTTP_VERSION: "HTTP/1.1"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "::1"
REMOTE_HOST: "::1"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Facebook JS SDK callback, then inspect devise_token_auth/omniauth_callbacks_controller.rb around line 109 and the shown omniauth parameters. Confirm how the callback resolves resource_class and identify the relevant existing callback test, since no test is named in the issue. Done means the callback completes without the RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.