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
I am using setup devise_token_auth for an API backend to a mobile app.
I am using:
devise (4.0.3)
devise_token_auth (0.1.37)
omniauth (1.3.1)
omniauth-facebook (3.0.0)
Rails 5.0.0.rc1 with API-only option
Everything works fine with email as a provider
In order to properly implement Facebook login in the client, and still be able to authenticate on the server, I am following the method indicated in the omniauth-gem:
which basically says to handle all login in the client, and once the user logins, redirect the client to the API callback URL at auth/facebook/callback and let Omniauth parse the signed cookie.
Since I am using devise_token_auth, at this point the gem should suppossedly generate a token and login with provider:facebook instead of provider:email.
First I had to turn on sessions in the middleware since omniauth needs them for some reason.
But now my problem is that I am getting this error when calling GET auth/facebook/callback regardless of any parameters/cookies being present:
ArgumentError (Before process_action callback :set_user_by_token has not been defined)
Full stack trace follows.
Any help would be appreciated.
Started GET "/auth/facebook/callback" for 127.0.0.1 at 2016-05-30 14:43:47 -0500
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
ArgumentError (Before process_action callback :set_user_by_token has not been defined):
I am using setup devise_token_auth for an API backend to a mobile app.
I am using:
devise (4.0.3)
devise_token_auth (0.1.37)
omniauth (1.3.1)
omniauth-facebook (3.0.0)
Rails 5.0.0.rc1 with API-only option
Everything works fine with email as a provider
In order to properly implement Facebook login in the client, and still be able to authenticate on the server, I am following the method indicated in the omniauth-gem:
https://github.com/mkdynamic/omniauth-facebook
See Section: Client-side Flow with Facebook Javascript SDK
which basically says to handle all login in the client, and once the user logins, redirect the client to the API callback URL at auth/facebook/callback and let Omniauth parse the signed cookie.
Since I am using devise_token_auth, at this point the gem should suppossedly generate a token and login with provider:facebook instead of provider:email.
First I had to turn on sessions in the middleware since omniauth needs them for some reason.
But now my problem is that I am getting this error when calling GET auth/facebook/callback regardless of any parameters/cookies being present:
ArgumentError (Before process_action callback :set_user_by_token has not been defined)
Full stack trace follows.
Any help would be appreciated.
Started GET "/auth/facebook/callback" for 127.0.0.1 at 2016-05-30 14:43:47 -0500
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
ArgumentError (Before process_action callback :set_user_by_token has not been defined):
activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:641:in
block (2 levels) in skip_callback' activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:637:in
each'activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:637:in
block in skip_callback' activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:568:in
block in **update_callbacks'activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:566:in
reverse_each' activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:566:in
__update_callbacks'activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:636:in
skip_callback' actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:210:in
block (3 levels) in module:ClassMethods'actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:93:in
block in _insert_callbacks' actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:92:in
each'actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:92:in
_insert_callbacks' actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:209:in
block (2 levels) in module:ClassMethods'devise_token_auth (0.1.37) app/controllers/devise_token_auth/omniauth_callbacks_controller.rb:5:in
<class:OmniauthCallbacksController>' devise_token_auth (0.1.37) app/controllers/devise_token_auth/omniauth_callbacks_controller.rb:2:in
module:DeviseTokenAuth'devise_token_auth (0.1.37) app/controllers/devise_token_auth/omniauth_callbacks_controller.rb:1:in
<top (required)>' activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:477:in
load'activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:477:in
block in load_file' activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:662:in
new_constants_in'activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:476:in
load_file' activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:375:in
block in require_or_load'activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:37:in
block in load_interlock' activesupport (5.0.0.rc1) lib/active_support/dependencies/interlock.rb:12:in
block in loading'activesupport (5.0.0.rc1) lib/active_support/concurrency/share_lock.rb:117:in
exclusive' activesupport (5.0.0.rc1) lib/active_support/dependencies/interlock.rb:11:in
loading'activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:37:in
load_interlock' activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:358:in
require_or_load'activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:511:in
load_missing_constant' activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:203:in
const_missing'activesupport (5.0.0.rc1) lib/active_support/inflector/methods.rb:270:in
const_get' activesupport (5.0.0.rc1) lib/active_support/inflector/methods.rb:270:in
block in constantize'activesupport (5.0.0.rc1) lib/active_support/inflector/methods.rb:266:in
each' activesupport (5.0.0.rc1) lib/active_support/inflector/methods.rb:266:in
inject'activesupport (5.0.0.rc1) lib/active_support/inflector/methods.rb:266:in
constantize' activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:583:in
get'activesupport (5.0.0.rc1) lib/active_support/dependencies.rb:614:in
constantize' actionpack (5.0.0.rc1) lib/action_dispatch/http/request.rb:93:in
controller_class'actionpack (5.0.0.rc1) lib/action_dispatch/routing/route_set.rb:44:in
controller' actionpack (5.0.0.rc1) lib/action_dispatch/routing/route_set.rb:30:in
serve'actionpack (5.0.0.rc1) lib/action_dispatch/routing/mapper.rb:16:in
block in <class:Constraints>' actionpack (5.0.0.rc1) lib/action_dispatch/routing/mapper.rb:46:in
serve'actionpack (5.0.0.rc1) lib/action_dispatch/journey/router.rb:39:in
block in serve' actionpack (5.0.0.rc1) lib/action_dispatch/journey/router.rb:26:in
each'actionpack (5.0.0.rc1) lib/action_dispatch/journey/router.rb:26:in
serve' actionpack (5.0.0.rc1) lib/action_dispatch/routing/route_set.rb:725:in
call'actionview (5.0.0.rc1) lib/action_view/digestor.rb:12:in
call' omniauth (1.3.1) lib/omniauth/strategy.rb:186:in
call!'omniauth (1.3.1) lib/omniauth/strategy.rb:164:in
call' omniauth (1.3.1) lib/omniauth/strategy.rb:186:in
call!'omniauth (1.3.1) lib/omniauth/strategy.rb:164:in
call' omniauth (1.3.1) lib/omniauth/builder.rb:63:in
call'rack-attack (4.4.1) lib/rack/attack.rb:100:in
call' rack (2.0.0.rc1) lib/rack/session/abstract/id.rb:222:in
context'rack (2.0.0.rc1) lib/rack/session/abstract/id.rb:216:in
call' actionpack (5.0.0.rc1) lib/action_dispatch/middleware/cookies.rb:613:in
call'warden (1.2.6) lib/warden/manager.rb:35:in
block in call' warden (1.2.6) lib/warden/manager.rb:34:in
catch'warden (1.2.6) lib/warden/manager.rb:34:in
call' rack (2.0.0.rc1) lib/rack/etag.rb:25:in
call'rack (2.0.0.rc1) lib/rack/conditional_get.rb:25:in
call' rack (2.0.0.rc1) lib/rack/head.rb:12:in
call'activerecord (5.0.0.rc1) lib/active_record/migration.rb:552:in
call' actionpack (5.0.0.rc1) lib/action_dispatch/middleware/callbacks.rb:38:in
block in call'activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:97:in
__run_callbacks**' activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:750:in
_run_call_callbacks'activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:90:in
run_callbacks' actionpack (5.0.0.rc1) lib/action_dispatch/middleware/callbacks.rb:36:in
call'actionpack (5.0.0.rc1) lib/action_dispatch/middleware/executor.rb:12:in
call' actionpack (5.0.0.rc1) lib/action_dispatch/middleware/remote_ip.rb:79:in
call'actionpack (5.0.0.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in
call' actionpack (5.0.0.rc1) lib/action_dispatch/middleware/show_exceptions.rb:31:in
call'railties (5.0.0.rc1) lib/rails/rack/logger.rb:36:in
call_app' railties (5.0.0.rc1) lib/rails/rack/logger.rb:24:in
block in call'activesupport (5.0.0.rc1) lib/active_support/tagged_logging.rb:70:in
block in tagged' activesupport (5.0.0.rc1) lib/active_support/tagged_logging.rb:26:in
tagged'activesupport (5.0.0.rc1) lib/active_support/tagged_logging.rb:70:in
tagged' railties (5.0.0.rc1) lib/rails/rack/logger.rb:24:in
call'actionpack (5.0.0.rc1) lib/action_dispatch/middleware/request_id.rb:24:in
call' rack (2.0.0.rc1) lib/rack/runtime.rb:22:in
call'activesupport (5.0.0.rc1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in
call' actionpack (5.0.0.rc1) lib/action_dispatch/middleware/executor.rb:12:in
call'actionpack (5.0.0.rc1) lib/action_dispatch/middleware/static.rb:136:in
call' rack (2.0.0.rc1) lib/rack/sendfile.rb:111:in
call'rack-cors (0.4.0) lib/rack/cors.rb:80:in
call' railties (5.0.0.rc1) lib/rails/engine.rb:522:in
call'puma (3.4.0) lib/puma/configuration.rb:224:in
call' puma (3.4.0) lib/puma/server.rb:569:in
handle_request'puma (3.4.0) lib/puma/server.rb:406:in
process_client' puma (3.4.0) lib/puma/server.rb:271:in
block in run'puma (3.4.0) lib/puma/thread_pool.rb:114:in`block in spawn_thread'
The text was updated successfully, but these errors were encountered: