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
602fe111
Commit
602fe111
authored
Jul 25, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove provider path, replace with dynamic path.
parent
e8c6f119
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
12 deletions
+7
-12
CHANGELOG
CHANGELOG
+1
-0
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+1
-1
app/helpers/auth_helper.rb
app/helpers/auth_helper.rb
+0
-6
app/views/devise/sessions/_new_crowd.html.haml
app/views/devise/sessions/_new_crowd.html.haml
+1
-1
app/views/devise/shared/_omniauth_box.html.haml
app/views/devise/shared/_omniauth_box.html.haml
+1
-1
app/views/profiles/accounts/show.html.haml
app/views/profiles/accounts/show.html.haml
+1
-1
spec/features/login_spec.rb
spec/features/login_spec.rb
+1
-1
spec/views/devise/shared/_signin_box.html.haml_spec.rb
spec/views/devise/shared/_signin_box.html.haml_spec.rb
+1
-1
No files found.
CHANGELOG
View file @
602fe111
...
@@ -20,6 +20,7 @@ v 8.11.0 (unreleased)
...
@@ -20,6 +20,7 @@ v 8.11.0 (unreleased)
- Update to gitlab_git 10.4.1 and take advantage of preserved Ref objects
- Update to gitlab_git 10.4.1 and take advantage of preserved Ref objects
- Retrieve rendered HTML from cache in one request
- Retrieve rendered HTML from cache in one request
- Fix renaming repository when name contains invalid chararacters under project settings
- Fix renaming repository when name contains invalid chararacters under project settings
- Fix devise deprecation warnings.
- Optimize checking if a user has read access to a list of issues !5370
- Optimize checking if a user has read access to a list of issues !5370
- Nokogiri's various parsing methods are now instrumented
- Nokogiri's various parsing methods are now instrumented
- Add a way to send an email and create an issue based on private personal token. Find the email address from issues page. !3363
- Add a way to send an email and create an issue based on private personal token. Find the email address from issues page. !3363
...
...
app/controllers/sessions_controller.rb
View file @
602fe111
...
@@ -101,7 +101,7 @@ class SessionsController < Devise::SessionsController
...
@@ -101,7 +101,7 @@ class SessionsController < Devise::SessionsController
# Prevent alert from popping up on the first page shown after authentication.
# Prevent alert from popping up on the first page shown after authentication.
flash
[
:alert
]
=
nil
flash
[
:alert
]
=
nil
redirect_to
provider_path
(
provider
)
redirect_to
omniauth_authorize_path
(
:user
,
provider
)
end
end
def
valid_otp_attempt?
(
user
)
def
valid_otp_attempt?
(
user
)
...
...
app/helpers/auth_helper.rb
View file @
602fe111
...
@@ -60,12 +60,6 @@ module AuthHelper
...
@@ -60,12 +60,6 @@ module AuthHelper
end
end
end
end
# Constructs the OAuth provider path.
# For example: user_google_omniauth_authorize_path
def
provider_path
(
provider
)
send
(
"user_
#{
provider
.
underscore
}
_omniauth_authorize_path"
)
end
def
auth_active?
(
provider
)
def
auth_active?
(
provider
)
current_user
.
identities
.
exists?
(
provider:
provider
.
to_s
)
current_user
.
identities
.
exists?
(
provider:
provider
.
to_s
)
end
end
...
...
app/views/devise/sessions/_new_crowd.html.haml
View file @
602fe111
=
form_tag
(
provider_path
(
"crowd"
),
id:
'new_crowd_user'
)
do
=
form_tag
(
omniauth_authorize_path
(
:user
,
:crowd
),
id:
'new_crowd_user'
)
do
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
placeholder:
"Username"
,
autofocus:
"autofocus"
}
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
placeholder:
"Username"
,
autofocus:
"autofocus"
}
=
password_field_tag
:password
,
nil
,
{
class:
"form-control bottom"
,
placeholder:
"Password"
}
=
password_field_tag
:password
,
nil
,
{
class:
"form-control bottom"
,
placeholder:
"Password"
}
-
if
devise_mapping
.
rememberable?
-
if
devise_mapping
.
rememberable?
...
...
app/views/devise/shared/_omniauth_box.html.haml
View file @
602fe111
...
@@ -5,4 +5,4 @@
...
@@ -5,4 +5,4 @@
-
providers
.
each
do
|
provider
|
-
providers
.
each
do
|
provider
|
%span
.light
%span
.light
-
has_icon
=
provider_has_icon?
(
provider
)
-
has_icon
=
provider_has_icon?
(
provider
)
=
link_to
provider_image_tag
(
provider
),
provider_path
(
provider
),
method: :post
,
class:
(
has_icon
?
'oauth-image-link'
:
'btn'
),
"data-no-turbolink"
=>
"true"
=
link_to
provider_image_tag
(
provider
),
omniauth_authorize_path
(
:user
,
provider
),
method: :post
,
class:
(
has_icon
?
'oauth-image-link'
:
'btn'
),
"data-no-turbolink"
=>
"true"
app/views/profiles/accounts/show.html.haml
View file @
602fe111
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
=
link_to
unlink_profile_account_path
(
provider:
provider
),
method: :delete
,
class:
'provider-btn'
do
=
link_to
unlink_profile_account_path
(
provider:
provider
),
method: :delete
,
class:
'provider-btn'
do
Disconnect
Disconnect
-
else
-
else
=
link_to
provider_path
(
provider
),
method: :post
,
class:
'provider-btn not-active'
,
"data-no-turbolink"
=>
"true"
do
=
link_to
omniauth_authorize_path
(
:user
,
provider
),
method: :post
,
class:
'provider-btn not-active'
,
"data-no-turbolink"
=>
"true"
do
Connect
Connect
%hr
%hr
-
if
current_user
.
can_change_username?
-
if
current_user
.
can_change_username?
...
...
spec/features/login_spec.rb
View file @
602fe111
...
@@ -128,7 +128,7 @@ feature 'Login', feature: true do
...
@@ -128,7 +128,7 @@ feature 'Login', feature: true do
end
end
allow
(
Gitlab
::
OAuth
::
Provider
).
to
receive_messages
(
providers:
[
:saml
],
config_for:
saml_config
)
allow
(
Gitlab
::
OAuth
::
Provider
).
to
receive_messages
(
providers:
[
:saml
],
config_for:
saml_config
)
allow
(
Gitlab
.
config
.
omniauth
).
to
receive_messages
(
messages
)
allow
(
Gitlab
.
config
.
omniauth
).
to
receive_messages
(
messages
)
allow_any_instance_of
(
Object
).
to
receive
(
:user_omniauth_authorize_path
).
with
(
'saml'
).
and_return
(
'/users/auth/saml'
)
expect_any_instance_of
(
Object
).
to
receive
(
:omniauth_authorize_path
).
with
(
:user
,
"saml"
).
and_return
(
'/users/auth/saml'
)
end
end
it
'should show 2FA prompt after OAuth login'
do
it
'should show 2FA prompt after OAuth login'
do
...
...
spec/views/devise/shared/_signin_box.html.haml_spec.rb
View file @
602fe111
...
@@ -31,7 +31,7 @@ describe 'devise/shared/_signin_box' do
...
@@ -31,7 +31,7 @@ describe 'devise/shared/_signin_box' do
def
enable_crowd
def
enable_crowd
allow
(
view
).
to
receive
(
:form_based_providers
).
and_return
([
:crowd
])
allow
(
view
).
to
receive
(
:form_based_providers
).
and_return
([
:crowd
])
allow
(
view
).
to
receive
(
:crowd_enabled?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:crowd_enabled?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:
user_omniauth_authorize_path
).
with
(
'crowd'
).
allow
(
view
).
to
receive
(
:
omniauth_authorize_path
).
with
(
:user
,
:crowd
).
and_return
(
'/crowd'
)
and_return
(
'/crowd'
)
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