Add public scoreboard slug & URL
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-22 18:21:13 +01:00
parent d47ebf22ab
commit 9a2a3a6f33
10 changed files with 31 additions and 8 deletions

View File

@@ -69,6 +69,6 @@ class ContestsController < ApplicationController
end
def contest_params
params.expect(contest: [ :name, :team, :allow_registration ])
params.expect(contest: [ :name, :team, :allow_registration, :slug ])
end
end

View File

@@ -1,13 +1,12 @@
class SessionsController < ApplicationController
allow_unauthenticated_access only: %i[ new create ]
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Try again later." }
before_action :skip_authorization
def new
skip_authorization
end
def create
skip_authorization
if user = User.authenticate_by(params.permit(:email_address, :password))
start_new_session_for user
redirect_to after_authentication_url