Mattias Bodlund 1 week ago
parent
commit
ae7fc08652
2 changed files with 0 additions and 14 deletions
  1. +0
    -1
      app/controllers/api/v1/leaderboard_controller.rb
  2. +0
    -13
      app/controllers/application_controller.rb

+ 0
- 1
app/controllers/api/v1/leaderboard_controller.rb View File

@ -1,6 +1,5 @@
class Api::V1::LeaderboardController < ApplicationController class Api::V1::LeaderboardController < ApplicationController
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
skip_before_action :authenticate
ACCESS_TOKEN = "ikea-tomato-2026" ACCESS_TOKEN = "ikea-tomato-2026"


+ 0
- 13
app/controllers/application_controller.rb View File

@ -1,20 +1,7 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_action :authenticate
OPEN_ACCESS_PERIOD = Date.new(2026, 8, 30)..Date.new(2026, 9, 6)
private private
def authenticate
return if OPEN_ACCESS_PERIOD.cover?(Date.current)
authenticate_or_request_with_http_basic do |name, password|
name == "stupid" && password == "studio"
end if Rails.env.production?
end
def set_locale def set_locale
I18n.locale = params[:locale].presence_in(I18n.available_locales.map(&:to_s)) || I18n.default_locale I18n.locale = params[:locale].presence_in(I18n.available_locales.map(&:to_s)) || I18n.default_locale
end end


Loading…
Cancel
Save