LoginSignup
0
0

More than 5 years have passed since last update.

Devise SNSログインの場合はconfirmationをスキップすべし

Posted at

Deviseを利用したログイン機能を作成しているとき、どうしても以下のようなエラーが出てつまったので、解決方法をメモとして残しておこうと思います。

スクリーンショット 2018-03-18 23.01.52.png

解決手段

なんか、confirmationのところでエラーが出てるっぽい。

そういえば、メール認証の場合はメールに送られたリンクをクリックしてアカウント確認を行なっていたことを思い出す。

ただ、SNSログインにそんなことは必要ないはず。
SNSログインの場合は、アカウント確認をなくせばいい。

解決法あった!!

user.skip_confirmation!
user.save


このコードは、saveの前に設定しておく。
confirmationはsaveする前に発火するので。

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