Prompt for first-run setup when no accounts exist
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user