mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-30 20:23:14 +08:00
Merge pull request #1767 from okriuchykhin/ok_SCI_2841
Improve handling of CSRF token errors [SCI-2841]
This commit is contained in:
commit
d12723f7c2
2 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,10 @@ class ApplicationController < ActionController::Base
|
|||
around_action :set_time_zone, if: :current_user
|
||||
layout 'main'
|
||||
|
||||
rescue_from ActionController::InvalidAuthenticityToken do
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
def respond_422(message = t('client_api.permission_error'))
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
class Users::SessionsController < Devise::SessionsController
|
||||
# before_filter :configure_sign_in_params, only: [:create]
|
||||
after_action :after_sign_in, only: :create
|
||||
|
||||
rescue_from ActionController::InvalidAuthenticityToken do
|
||||
redirect_to new_user_session_path
|
||||
end
|
||||
|
||||
# GET /resource/sign_in
|
||||
def new
|
||||
# If user was redirected here from OAuth's authorize/new page (Doorkeeper
|
||||
|
|
Loading…
Reference in a new issue