diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index e65b27db3ae135cf72dd0f8d4547006c971240ed..aa9c7d01ba356c5ff1ff9a779a0eb0bd6d3df46c 100644 --- a/app/controllers/invites_controller.rb +++ b/app/controllers/invites_controller.rb @@ -76,8 +76,10 @@ def authenticate_user! notice << "or create an account" if Gitlab::CurrentSettings.allow_signup? notice = notice.join(' ') + "." + # this is temporary finder instead of using member method due to render_404 possibility + # will be resolved via https://gitlab.com/gitlab-org/gitlab/-/issues/245325 initial_member = Member.find_by_invite_token(params[:id]) - redirect_params = initial_member ? { invite_email: member.invite_email } : {} + redirect_params = initial_member ? { invite_email: initial_member.invite_email } : {} store_location_for :user, request.fullpath diff --git a/changelogs/unreleased/241359-nomethoderror-error.yml b/changelogs/unreleased/241359-nomethoderror-error.yml new file mode 100644 index 0000000000000000000000000000000000000000..abd3c27e62b81baffb3652bcbb586c14498249e0 --- /dev/null +++ b/changelogs/unreleased/241359-nomethoderror-error.yml @@ -0,0 +1,5 @@ +--- +title: 'Do not raise error when a member is not found by invite token' +merge_request: 42349 +author: +type: fixed