omniauthでログイン後に元のページに戻る

omniauthでログイン後に元のページに戻る処理のメモ

redirect_to request.env['omniauth.origin']

request.env['omniauth.origin']から元のページのURLを取得する。

参考