app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
# protect_from_forgery with: :exception
# before_filter :require_user
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def authentication_required
    return if signed_in?
    respond_to do |format|
      format.html  {
        url = '/auth/orcid?origin=' + CGI.escape(request.url)
        redirect_to url, status: :forbidden
      }
      format.json {
        render json: { error: 'Access Denied' }, status: :forbidden
      }
    end
  end
def authentication_required return if signed_in? respond_to do | format | format . html { url = '/auth/orcid?origin=' + CGI . escape ( request . url ) redirect_to url , status : :forbidden } format . json { render json : { error : 'Access Denied' } , status : :forbidden } end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .