Prompt for first-run setup when no accounts exist

This commit is contained in:
Jeffrey Hardy
2024-09-30 13:17:31 -04:00
parent dc60c9b1a2
commit 7863bb5862
8 changed files with 116 additions and 2 deletions
+7
View File
@@ -2,6 +2,8 @@ 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 :require_first_run_completion
def new
end
@@ -18,4 +20,9 @@ class SessionsController < ApplicationController
terminate_session
redirect_to new_session_url
end
private
def require_first_run_completion
redirect_to first_run_url if Account.none?
end
end