LoginSignup
0
0

More than 5 years have passed since last update.

RailsのLINEbotでdeviseを使ったら突然「Processing by UsersController#callback as */*」っていわれた話

Last updated at Posted at 2018-11-21

環境

ruby '2.5.0'
gem 'rails', '~> 5.2.1'

詰まったこと

deviseでLINE連携させてLINEbotをでとったデータを使っていろいろとやろうとしたときに突然LINEbotが動かなくなりターミナルを見ると

Processing by UsersController#callback as */*

という1文が、、、
ググってもなんにも出てこないので仕方なく
gitでcommit logをさかのぼりながら細かく確認して見ていると、、、

原因

 class ApplicationController < ActionController::Base  
   protect_from_forgery with: :exception 
   before_action :configure_permitted_parameters, if: :devise_controller? 
   before_action :authenticate_user! #←これのせい

ApplicationControlleの中の「:authenticate_user!」が原因でした。
おそらくLINEボットからcallbackされるときはログイン状態では無いからauthenticate_user!が動いてしまって「new_user_session_path」に飛ばされてしまったからうまく動かなかったのかな〜って思います。

まとめ

当たり前ですけどgitで細かくcommitしてcommitメッセージも自分で何したかわかるくらいは書いておくとこういうググっても出てこない系に対処できていいですね笑
これをきにちゃんと細かくcommitして行こうと心に誓いました笑

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0