diff --git a/.dockerignore b/.dockerignore
index c085d97c..107e1389 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -27,3 +27,4 @@
/attachments
/docuseal
.DS_Store
+.env
diff --git a/app/controllers/console_redirect_controller.rb b/app/controllers/console_redirect_controller.rb
index 2424c9da..ba3565dc 100644
--- a/app/controllers/console_redirect_controller.rb
+++ b/app/controllers/console_redirect_controller.rb
@@ -3,7 +3,7 @@
class ConsoleRedirectController < ApplicationController
def index
auth = JsonWebToken.encode(uuid: current_user.uuid,
- action: :sign_in,
+ scope: :console,
exp: 1.minute.from_now.to_i)
redirect_to("#{Docuseal::CONSOLE_URL}?#{{ auth: }.to_query}", allow_other_host: true)
diff --git a/app/javascript/elements/menu_active.js b/app/javascript/elements/menu_active.js
index e9c434d2..819e9259 100644
--- a/app/javascript/elements/menu_active.js
+++ b/app/javascript/elements/menu_active.js
@@ -1,7 +1,7 @@
export default class extends HTMLElement {
connectedCallback () {
this.querySelectorAll('a').forEach((link) => {
- if (document.location.pathname.startsWith(link.pathname)) {
+ if (document.location.pathname.startsWith(link.pathname) && !link.getAttribute('href').startsWith('http')) {
link.classList.add('bg-base-300')
}
})
diff --git a/app/models/user.rb b/app/models/user.rb
index 7e7e023b..8d5a098e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -42,8 +42,7 @@
class User < ApplicationRecord
ROLES = %w[admin].freeze
- EMAIL_REGEXP =
- /[a-z0-9][.']?(?:(?:[a-z0-9_-]++[.'])*[a-z0-9_-]++)*@(?:[a-z0-9]++[.-])*[a-z0-9]++\.[a-z]{2,}/i
+ EMAIL_REGEXP = /[^@,\s]+@[^@,\s]+/
belongs_to :account
diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb
index 13e663c4..5700bc14 100644
--- a/app/views/shared/_settings_nav.html.erb
+++ b/app/views/shared/_settings_nav.html.erb
@@ -23,7 +23,7 @@
<%= link_to 'Team', settings_users_path, class: 'text-base hover:bg-base-300' %>
- <% unless Docuseal.multitenant? %>
+ <% if Docuseal.demo? || !Docuseal.multitenant? %>
<%= link_to 'API', settings_api_index_path, class: 'text-base hover:bg-base-300' %>
@@ -31,9 +31,14 @@
<%= link_to 'Webhooks', settings_webhooks_path, class: 'text-base hover:bg-base-300' %>
<% end %>
-
- <%= link_to 'Console', console_redirect_index_path, class: 'text-base hover:bg-base-300' %>
-
+ <% unless Docuseal.demo? %>
+
+ <%= link_to Docuseal.multitenant? ? console_redirect_index_path : Docuseal::CONSOLE_URL, class: 'text-base hover:bg-base-300' do %>
+ Console
+ New
+ <% end %>
+
+ <% end %>
diff --git a/config/application.rb b/config/application.rb
index 7991f878..bb5d5e1f 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -9,7 +9,7 @@ require 'action_view/railtie'
require 'action_mailer/railtie'
require 'active_job/railtie'
-require './lib/api_path_consider_json_middleware'
+require_relative '../lib/api_path_consider_json_middleware'
Bundler.require(*Rails.groups)
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 8cb07803..85145bdc 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require './lib/auth_with_token_strategy'
+require_relative '../../lib/auth_with_token_strategy'
Warden::Strategies.add(:auth_token, AuthWithTokenStrategy)
diff --git a/config/routes.rb b/config/routes.rb
index d1458bce..f05a2e39 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -70,8 +70,10 @@ Rails.application.routes.draw do
end
resources :esign, only: %i[index create], controller: 'esign_settings'
resources :users, only: %i[index]
- resources :api, only: %i[index], controller: 'api_settings' unless Docuseal.multitenant?
- resource :webhooks, only: %i[show create update], controller: 'webhook_settings' unless Docuseal.multitenant?
+ if !Docuseal.multitenant? || Docuseal.demo?
+ resources :api, only: %i[index], controller: 'api_settings'
+ resource :webhooks, only: %i[show create update], controller: 'webhook_settings'
+ end
resource :account, only: %i[show update]
resources :profile, only: %i[index] do
collection do