Skip to content

Commit

Permalink
Allow Anonymous: Fix after sign up redirect path (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
pglombardo authored Nov 6, 2024
1 parent 50e8cb7 commit 744291a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
4 changes: 4 additions & 0 deletions app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ def regen_token
# super(resource)
# end

def after_inactive_sign_up_path_for(resource)
new_user_session_path
end

# The path used after sign up for inactive accounts.
# def after_inactive_sign_up_path_for(resource)
# super(resource)
Expand Down
23 changes: 12 additions & 11 deletions config/routes/users.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
devise_for :users, skip: :registrations, controllers: {
sessions: "users/sessions",
passwords: "users/passwords",
unlocks: "users/unlocks",
confirmations: "users/confirmations"
}

allowed_reg_routes = if Settings.disable_signups
%i[edit update]
else
%i[new create edit update]
end

devise_for :users, skip: :registrations, controllers: {
sessions: "users/sessions",
passwords: "users/passwords",
unlocks: "users/unlocks",
confirmations: "users/confirmations",
registrations: "users/registrations"
}

devise_scope :user do
resource :registration,
only: allowed_reg_routes,
path: "users",
path_names: {new: "sign_up"},
controller: "users/registrations",
as: :user_registration do
get :cancel
get :token
delete :token, action: :regen_token
end
get :cancel
get :token
delete :token, action: :regen_token
end
end

0 comments on commit 744291a

Please sign in to comment.