Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Upstream
Gitea
Commits
bbe6aa34
Commit
bbe6aa34
authored
8 years ago
by
Lunny Xiao
Committed by
Bo-Yi Wu
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix bug not to trim space of login username (#1806)
parent
4fd55d87
v1.1.4
v1.1.3
v1.1.2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/login_source.go
+6
-1
models/login_source.go
with
6 additions
and
1 deletion
+6
-1
models/login_source.go
View file @
bbe6aa34
...
@@ -635,7 +635,12 @@ func UserSignIn(username, password string) (*User, error) {
...
@@ -635,7 +635,12 @@ func UserSignIn(username, password string) (*User, error) {
}
}
}
}
}
else
{
}
else
{
user
=
&
User
{
LowerName
:
strings
.
ToLower
(
strings
.
TrimSpace
(
username
))}
trimmedUsername
:=
strings
.
TrimSpace
(
username
)
if
len
(
trimmedUsername
)
==
0
{
return
nil
,
ErrUserNotExist
{
0
,
username
,
0
}
}
user
=
&
User
{
LowerName
:
strings
.
ToLower
(
trimmedUsername
)}
}
}
hasUser
,
err
:=
x
.
Get
(
user
)
hasUser
,
err
:=
x
.
Get
(
user
)
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help