Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NGINX Authenticator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ula
NGINX Authenticator
Commits
21ddfb9b
Commit
21ddfb9b
authored
3 months ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Log authentication attempts
parent
a65a2c1a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#81779
canceled
3 months ago
Stage: build
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
auth.go
+7
-3
7 additions, 3 deletions
auth.go
with
7 additions
and
3 deletions
auth.go
+
7
−
3
View file @
21ddfb9b
...
...
@@ -28,9 +28,13 @@ func authenticate(username, password string) bool {
func
handleAuthenticate
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
status
:=
http
.
StatusForbidden
username
,
password
,
ok
:=
req
.
BasicAuth
()
if
ok
&&
authenticate
(
username
,
password
)
{
status
=
http
.
StatusOK
if
username
,
password
,
ok
:=
req
.
BasicAuth
();
ok
{
if
authenticate
(
username
,
password
)
{
status
=
http
.
StatusOK
log
.
Printf
(
"auth(%s) -> ok"
,
username
)
}
else
{
log
.
Printf
(
"auth(%s) -> ERROR"
,
username
)
}
}
w
.
WriteHeader
(
status
)
...
...
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