mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
Add onboarding state selector for self-hosted signup (#251)
* Add onboarding modes to self-hosted signup * Style form consistently * Configure ONBOARDING_STATE via ENV
This commit is contained in:
@@ -3,6 +3,7 @@ class RegistrationsController < ApplicationController
|
||||
|
||||
layout "auth"
|
||||
|
||||
before_action :ensure_signup_open, if: :self_hosted?
|
||||
before_action :set_user, only: :create
|
||||
before_action :set_invitation
|
||||
before_action :claim_invite_code, only: :create, if: :invite_code_required?
|
||||
@@ -79,4 +80,10 @@ class RegistrationsController < ApplicationController
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
def ensure_signup_open
|
||||
return unless Setting.onboarding_state == "closed"
|
||||
|
||||
redirect_to new_session_path, alert: t("registrations.closed")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user