Sha256: 007b47eeae930877eb64c2ed22215830f0a5ac4435a3fc586d8a63b3ad6aa134

Contents?: true

Size: 296 Bytes

Versions: 4

Compression:

Stored size: 296 Bytes

Contents

ActionInterceptor.configure do

  interceptor :authenticate_user! do
    account = current_account

    return if account && !account.is_anonymous?

    respond_to do |format|
      format.html { redirect_to openstax_accounts.login_url }
      format.json { head(:forbidden) }
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openstax_accounts-4.0.0 config/initializers/action_interceptor.rb
openstax_accounts-3.1.1 config/initializers/action_interceptor.rb
openstax_accounts-3.1.0 config/initializers/action_interceptor.rb
openstax_accounts-3.0.0 config/initializers/action_interceptor.rb