Commit 02810094 authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '20204-new-issue-button-redirects-you-to-create-a-new-issue-after-logging-in' into 'master'

Resolve "New issue button redirects you to create a new issue after logging in"

Closes #20204

See merge request !10153
parents 8d4f55c2 97941d2c
......@@ -260,4 +260,13 @@ class Projects::IssuesController < Projects::ApplicationController
:milestone_id, :due_date, :state_event, :task_num, :lock_version, label_ids: []
)
end
def authenticate_user!
return if current_user
notice = "Please sign in to create the new issue."
store_location_for :user, request.fullpath
redirect_to new_user_session_path, notice: notice
end
end
......@@ -90,6 +90,7 @@ describe Projects::IssuesController do
it 'redirects to signin if not logged in' do
get :new, namespace_id: project.namespace, project_id: project
expect(flash[:notice]).to eq 'Please sign in to create the new issue.'
expect(response).to redirect_to(new_user_session_path)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment