class Razoul::GeneratorController

Public Instance Methods

authenticate!() click to toggle source
# File lib/razoul/controllers/generator_controller.rb, line 13
def authenticate!
  render_error unless Razoul::User.authenticate(auth_params)
end
new() click to toggle source
# File lib/razoul/controllers/generator_controller.rb, line 5
def new
  render json: Razoul::Token.generate!
end
show() click to toggle source
# File lib/razoul/controllers/generator_controller.rb, line 9
def show
  render json: Razoul::Token.current_token
end

Private Instance Methods

auth_params() click to toggle source
# File lib/razoul/controllers/generator_controller.rb, line 18
def auth_params
  {login: request.headers['HTTP_RAZOUL_LOGIN'],
   password: request.headers['HTTP_RAZOUL_PASSWORD']}
end