class ApplicationController < ActionController::Base
  before_action :authenticate


private

  def authenticate
    authenticate_or_request_with_http_basic do |name, password|
      name == "stupid" && password == "studio"
    end if Rails.env.production?
  end


  def set_locale
    I18n.locale = params[:locale].presence_in(I18n.available_locales.map(&:to_s)) || I18n.default_locale
  end


  def not_found
    raise ActionController::RoutingError.new("Not Found")
  end
end
