diff --git a/app/controllers/console_redirect_controller.rb b/app/controllers/console_redirect_controller.rb new file mode 100644 index 00000000..2424c9da --- /dev/null +++ b/app/controllers/console_redirect_controller.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ConsoleRedirectController < ApplicationController + def index + auth = JsonWebToken.encode(uuid: current_user.uuid, + action: :sign_in, + exp: 1.minute.from_now.to_i) + + redirect_to("#{Docuseal::CONSOLE_URL}?#{{ auth: }.to_query}", allow_other_host: true) + end +end diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index 7b890467..20f48c25 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -23,6 +23,9 @@
  • <%= link_to 'Team', settings_users_path, class: 'text-base hover:bg-base-300' %>
  • +
  • + <%= link_to 'Console', console_redirect_index_path, class: 'text-base hover:bg-base-300' %> +