Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
b5a06d29
Commit
b5a06d29
authored
Jan 14, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use common error for unauthenticated users
Removes special error message when creating new issues
parent
7a10ef6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-9
changelogs/unreleased/security-fix-new-issues-login-message.yml
...logs/unreleased/security-fix-new-issues-login-message.yml
+5
-0
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+1
-1
No files found.
app/controllers/projects/issues_controller.rb
View file @
b5a06d29
...
@@ -19,7 +19,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -19,7 +19,7 @@ class Projects::IssuesController < Projects::ApplicationController
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:calendar
])
{
authenticate_sessionless_user!
(
:ics
)
}
prepend_before_action
(
only:
[
:calendar
])
{
authenticate_sessionless_user!
(
:ics
)
}
prepend_before_action
:authenticate_
new_issue
!
,
only:
[
:new
]
prepend_before_action
:authenticate_
user
!
,
only:
[
:new
]
prepend_before_action
:store_uri
,
only:
[
:new
,
:show
]
prepend_before_action
:store_uri
,
only:
[
:new
,
:show
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
...
@@ -247,14 +247,6 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -247,14 +247,6 @@ class Projects::IssuesController < Projects::ApplicationController
]
+
[{
label_ids:
[],
assignee_ids:
[]
}]
]
+
[{
label_ids:
[],
assignee_ids:
[]
}]
end
end
def
authenticate_new_issue!
return
if
current_user
notice
=
"Please sign in to create the new issue."
redirect_to
new_user_session_path
,
notice:
notice
end
def
store_uri
def
store_uri
if
request
.
get?
&&
!
request
.
xhr?
if
request
.
get?
&&
!
request
.
xhr?
store_location_for
:user
,
request
.
fullpath
store_location_for
:user
,
request
.
fullpath
...
...
changelogs/unreleased/security-fix-new-issues-login-message.yml
0 → 100644
View file @
b5a06d29
---
title
:
Use common error for unauthenticated users when creating issues
merge_request
:
author
:
type
:
security
spec/controllers/projects/issues_controller_spec.rb
View file @
b5a06d29
...
@@ -131,7 +131,7 @@ describe Projects::IssuesController do
...
@@ -131,7 +131,7 @@ describe Projects::IssuesController do
it
'redirects to signin if not logged in'
do
it
'redirects to signin if not logged in'
do
get
:new
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
get
:new
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
flash
[
:
notice
]).
to
eq
'Please sign in to create the new issue
.'
expect
(
flash
[
:
alert
]).
to
eq
'You need to sign in or sign up before continuing
.'
expect
(
response
).
to
redirect_to
(
new_user_session_path
)
expect
(
response
).
to
redirect_to
(
new_user_session_path
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment