add demo configs

This commit is contained in:
Alex Turchyn
2023-07-05 00:22:05 +03:00
parent 8f97d2f6f7
commit 4234198b46
2 changed files with 9 additions and 0 deletions
@@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
include ActiveStorage::SetCurrent
include Pagy::Backend
before_action :sign_in_for_demo, if: -> { Docuseal.demo? }
before_action :maybe_redirect_to_setup, unless: :signed_in?
before_action :authenticate_user!, unless: :devise_controller?
@@ -21,6 +22,10 @@ class ApplicationController < ActionController::Base
private
def sign_in_for_demo
sign_in(User.first) unless signed_in?
end
def current_account
current_user&.account
end