Sha256: 95d801c41ec51b20505e75d3af9d0d6afee11f166ab349f5e5be35c70747f375

Contents?: true

Size: 889 Bytes

Versions: 2

Compression:

Stored size: 889 Bytes

Contents

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  # While `acts_as_token_authentication_handler` was not called,
  # neither should be `authenticate_user!`.
  # See https://github.com/gonzalo-bulnes/simple_token_authentication/issues/8
  #
  # Yet once `acts_as_token_authentication_handler` was called, `authenticate_user!`
  # should also be called. Run `rspec` to ensure that's being true.
  # If called, the `authenticate_user!` method will raise an exception, that
  # allows both cases to be covered by their own spec example.
  #
  # See test/dummy/app/controllers/posts_controller.rb and
  # test/dummy/app/controllers/private_posts_controller.rb

  def authenticate_user!
    raise "`authenticate_user!` was called."
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_token_authentication-1.0.0.pre.5 test/dummy/app/controllers/application_controller.rb
simple_token_authentication-1.0.0.beta.5 test/dummy/app/controllers/application_controller.rb