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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3f09ab76
Commit
3f09ab76
authored
Apr 30, 2021
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect to root or back when invite not found
- provide a more friendly user experience instead of 404'ing them.
parent
e16f9470
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
app/controllers/invites_controller.rb
app/controllers/invites_controller.rb
+1
-1
changelogs/unreleased/326734-previously-accepted-invites-should-redirect-to-the-gitlab-product.yml
...ccepted-invites-should-redirect-to-the-gitlab-product.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/controllers/invites_controller_spec.rb
spec/controllers/invites_controller_spec.rb
+3
-2
No files found.
app/controllers/invites_controller.rb
View file @
3f09ab76
...
@@ -84,7 +84,7 @@ class InvitesController < ApplicationController
...
@@ -84,7 +84,7 @@ class InvitesController < ApplicationController
def
ensure_member_exists
def
ensure_member_exists
return
if
member
return
if
member
re
nder_404
re
direct_back_or_default
(
options:
{
alert:
_
(
"The invitation can not be found with the provided invite token."
)
})
end
end
def
authenticate_user!
def
authenticate_user!
...
...
changelogs/unreleased/326734-previously-accepted-invites-should-redirect-to-the-gitlab-product.yml
0 → 100644
View file @
3f09ab76
---
title
:
Invalid invite tokens should redirect to the GitLab product
merge_request
:
60666
author
:
type
:
other
locale/gitlab.pot
View file @
3f09ab76
...
@@ -31802,6 +31802,9 @@ msgstr ""
...
@@ -31802,6 +31802,9 @@ msgstr ""
msgid "The interval must be one of %{intervals}."
msgid "The interval must be one of %{intervals}."
msgstr ""
msgstr ""
msgid "The invitation can not be found with the provided invite token."
msgstr ""
msgid "The invitation could not be accepted."
msgid "The invitation could not be accepted."
msgstr ""
msgstr ""
...
...
spec/controllers/invites_controller_spec.rb
View file @
3f09ab76
...
@@ -14,10 +14,11 @@ RSpec.describe InvitesController do
...
@@ -14,10 +14,11 @@ RSpec.describe InvitesController do
context
'when invite token is not valid'
do
context
'when invite token is not valid'
do
let
(
:params
)
{
{
id:
'_bogus_token_'
}
}
let
(
:params
)
{
{
id:
'_bogus_token_'
}
}
it
're
nders the 404 page
'
do
it
're
directs to root
'
do
request
request
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
response
).
to
redirect_to
(
root_path
)
expect
(
controller
).
to
set_flash
[
:alert
].
to
(
'The invitation can not be found with the provided invite token.'
)
end
end
end
end
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