Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Anonymous=false: Fix after sign up redirect path #2735

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading