Devise, OmniAuth & Facebook: “Not found. Authentication passthru.”

前端 未结 9 1179
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 16:59

Trying to follow along with https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview and I\'m stumped.

I\'ve got config.omniauth :facebook, ENV[\'FB_AP

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 17:22

    Try setting omniauth_path_prefix in devise initializer (config/initializers/devise.rb) file.

    For User class:

    config.omniauth_path_prefix = "/users/auth"
    

    For other class (e.g. when you use Account not User):

    config.omniauth_path_prefix = "/accounts/auth"
    

    Same thing with translated routes (my case). I've tranlated 'users' into 'blabla'. To have it working I had to set prefix to "/blabla/auth". (Works for only one locale!)

提交回复
热议问题