From 601c984f3f8a7cb65c23dc0f429be2454d3bb1ed Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Fri, 25 Aug 2023 23:54:55 +0300 Subject: [PATCH] do not display registration routes for signed up users --- config/routes.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index ec81cd86..7d2ead41 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,9 +16,11 @@ Rails.application.routes.draw do devise_scope :user do if Docuseal.multitenant? - resource :registration, only: %i[show], path: 'sign_up' - resource :registration, only: %i[create], path: 'new' do - get '' => :new, as: :new + unauthenticated do + resource :registration, only: %i[show], path: 'sign_up' + resource :registration, only: %i[create], path: 'new' do + get '' => :new, as: :new + end end end