BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
55efb2d9
Commit
55efb2d9
authored
Jul 07, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'redirect_after_login' into 'master'"
This reverts commit
5aaa3565
, reversing changes made to
5b8c1767
.
parent
f3b0cb77
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
42 deletions
+7
-42
application_controller.rb
app/controllers/application_controller.rb
+1
-1
users_sessions_controller.rb
app/controllers/users_sessions_controller.rb
+0
-6
_new_base.html.haml
app/views/devise/sessions/_new_base.html.haml
+3
-3
_public_head_panel.html.haml
app/views/layouts/_public_head_panel.html.haml
+2
-2
routes.rb
config/routes.rb
+1
-1
redirects.feature
features/project/redirects.feature
+0
-7
redirects.rb
features/steps/project/redirects.rb
+0
-22
No files found.
app/controllers/application_controller.rb
View file @
55efb2d9
...
...
@@ -68,7 +68,7 @@ class ApplicationController < ActionController::Base
flash
[
:alert
]
=
"Your account is blocked. Retry when an admin has unblocked it."
new_user_session_path
else
@return_to
||
root_path
super
end
end
...
...
app/controllers/users_sessions_controller.rb
deleted
100644 → 0
View file @
f3b0cb77
class
UsersSessionsController
<
Devise
::
SessionsController
def
create
@return_to
=
params
[
:return_to
]
super
end
end
app/views/devise/sessions/_new_base.html.haml
View file @
55efb2d9
...
...
@@ -7,8 +7,8 @@
=
f
.
check_box
:remember_me
%span
Remember me
%div
=
hidden_field_tag
'return_to'
,
params
[
:return_to
]
=
f
.
submit
"Sign in"
,
class:
"btn-save btn"
=
f
.
submit
"Sign in"
,
class:
"btn-create btn"
.pull-right
=
link_to
"Forgot your password?"
,
new_password_path
(
resource_name
),
class:
"btn"
app/views/layouts/_public_head_panel.html.haml
View file @
55efb2d9
...
...
@@ -13,10 +13,10 @@
%i
.icon-reorder
.pull-right.hidden-xs
=
link_to
"Sign in"
,
new_session_path
(
:user
,
return_to:
request
.
fullpath
),
class:
'btn btn-sign-in btn-new'
=
link_to
"Sign in"
,
new_session_path
(
:user
),
class:
'btn btn-sign-in btn-new'
.navbar-collapse.collapse
%ul
.nav.navbar-nav
%li
.visible-xs
=
link_to
"Sign in"
,
new_session_path
(
:user
,
return_to:
request
.
fullpath
)
=
link_to
"Sign in"
,
new_session_path
(
:user
)
config/routes.rb
View file @
55efb2d9
...
...
@@ -160,7 +160,7 @@ Gitlab::Application.routes.draw do
resources
:projects
,
constraints:
{
id:
/[^\/]+/
},
only:
[
:new
,
:create
]
devise_for
:users
,
controllers:
{
omniauth_callbacks: :omniauth_callbacks
,
registrations: :registrations
,
passwords: :passwords
,
sessions: :users_sessions
}
devise_for
:users
,
controllers:
{
omniauth_callbacks: :omniauth_callbacks
,
registrations: :registrations
,
passwords: :passwords
}
devise_scope
:user
do
get
"/users/auth/:provider/omniauth_error"
=>
"omniauth_callbacks#omniauth_error"
,
as: :omniauth_error
...
...
features/project/redirects.feature
View file @
55efb2d9
...
...
@@ -24,10 +24,3 @@ Feature: Project Redirects
Given
I sign in as a user
When
I visit project
"Enterprise"
page
Then
page status code should be 404
Scenario
:
I
visit a public project without signing in
When
I visit project
"Community"
page
And
I should see project
"Community"
home page
And
I click on
"Sign In"
And
Authenticate
Then
I should be redirected to
"Community"
page
features/steps/project/redirects.rb
View file @
55efb2d9
...
...
@@ -31,27 +31,5 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
project
=
Project
.
find_by
(
name:
'Community'
)
visit
project_path
(
project
)
+
'DoesNotExist'
end
step
'I click on "Sign In"'
do
within
'.pull-right'
do
click_link
"Sign in"
end
end
step
'Authenticate'
do
admin
=
create
(
:admin
)
project
=
Project
.
find_by
(
name:
'Community'
)
find
(
:xpath
,
"//input[@id='return_to']"
).
set
"/
#{
project
.
path_with_namespace
}
"
fill_in
"user_login"
,
with:
admin
.
email
fill_in
"user_password"
,
with:
admin
.
password
click_button
"Sign in"
Thread
.
current
[
:current_user
]
=
admin
end
step
'I should be redirected to "Community" page'
do
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
current_path
.
should
==
"/
#{
project
.
path_with_namespace
}
"
page
.
status_code
.
should
==
200
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