Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
f37f4c1e
Unverified
Commit
f37f4c1e
authored
Jun 1, 2021
by
Ahmad Farhat
Committed by
GitHub
Jun 1, 2021
Browse files
Options
Downloads
Patches
Plain Diff
Fix LDAP password string (#2747)
* Fix LDAP password string * Rspec
parent
58728073
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/sessions_controller.rb
+2
-2
2 additions, 2 deletions
app/controllers/sessions_controller.rb
config/locales/en.yml
+1
-0
1 addition, 0 deletions
config/locales/en.yml
spec/controllers/sessions_controller_spec.rb
+3
-3
3 additions, 3 deletions
spec/controllers/sessions_controller_spec.rb
with
6 additions
and
5 deletions
app/controllers/sessions_controller.rb
+
2
−
2
View file @
f37f4c1e
...
...
@@ -146,12 +146,12 @@ class SessionsController < ApplicationController
ldap_config
[
:uid
]
=
ENV
[
'LDAP_UID'
]
if
params
[
:session
][
:username
].
blank?
||
session_params
[
:password
].
blank?
return
redirect_to
(
ldap_signin_path
,
alert:
I18n
.
t
(
"invalid_credentials"
))
return
redirect_to
(
ldap_signin_path
,
alert:
I18n
.
t
(
"invalid_credentials
_external
"
))
end
result
=
send_ldap_request
(
params
[
:session
],
ldap_config
)
return
redirect_to
(
ldap_signin_path
,
alert:
I18n
.
t
(
"invalid_credentials"
))
unless
result
return
redirect_to
(
ldap_signin_path
,
alert:
I18n
.
t
(
"invalid_credentials
_external
"
))
unless
result
@auth
=
parse_auth
(
result
.
first
,
ENV
[
'LDAP_ROLE_FIELD'
],
ENV
[
'LDAP_ATTRIBUTE_MAPPING'
])
...
...
This diff is collapsed.
Click to expand it.
config/locales/en.yml
+
1
−
0
View file @
f37f4c1e
...
...
@@ -314,6 +314,7 @@ en:
home_room
:
Home Room
info_update_success
:
Information successfully updated.
invalid_credentials
:
The email and password you entered did not match our records. Try again or click Forgot Password to reset your password.
invalid_credentials_external
:
The email and password you entered did not match our records. Please try again.
invalid_login_method
:
Login failed due to account mismatch. You need to log in with omniauth.
invite_message
:
"
To
invite
someone
to
the
meeting,
send
them
this
link:"
javascript
:
...
...
This diff is collapsed.
Click to expand it.
spec/controllers/sessions_controller_spec.rb
+
3
−
3
View file @
f37f4c1e
...
...
@@ -658,7 +658,7 @@ describe SessionsController, type: :controller do
}
expect
(
response
).
to
redirect_to
(
ldap_signin_path
)
expect
(
flash
[
:alert
]).
to
eq
(
I18n
.
t
(
"invalid_credentials"
))
expect
(
flash
[
:alert
]).
to
eq
(
I18n
.
t
(
"invalid_credentials
_external
"
))
end
it
"redirects to signin if no password provided"
do
...
...
@@ -672,7 +672,7 @@ describe SessionsController, type: :controller do
}
expect
(
response
).
to
redirect_to
(
ldap_signin_path
)
expect
(
flash
[
:alert
]).
to
eq
(
I18n
.
t
(
"invalid_credentials"
))
expect
(
flash
[
:alert
]).
to
eq
(
I18n
.
t
(
"invalid_credentials
_external
"
))
end
it
"redirects to signin if no username provided"
do
...
...
@@ -686,7 +686,7 @@ describe SessionsController, type: :controller do
}
expect
(
response
).
to
redirect_to
(
ldap_signin_path
)
expect
(
flash
[
:alert
]).
to
eq
(
I18n
.
t
(
"invalid_credentials"
))
expect
(
flash
[
:alert
]).
to
eq
(
I18n
.
t
(
"invalid_credentials
_external
"
))
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment