aboutsummaryrefslogtreecommitdiff
path: root/internal/route/user
diff options
context:
space:
mode:
authordeepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>2022-03-06 16:33:45 +0800
committerGitHub <noreply@github.com>2022-03-06 16:33:45 +0800
commitdeec3516d53e9a9679128ade0556ccc818a67be1 (patch)
treeb5c1c5d55be05a244180ece0b822e7e35dc68f42 /internal/route/user
parent65526f84e1d382ac01b7379f40fc56b2660d1074 (diff)
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/route/user')
-rw-r--r--internal/route/user/auth.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/route/user/auth.go b/internal/route/user/auth.go
index 26eb7d4b..87e23b4b 100644
--- a/internal/route/user/auth.go
+++ b/internal/route/user/auth.go
@@ -38,7 +38,7 @@ func AutoLogin(c *context.Context) (bool, error) {
}
uname := c.GetCookie(conf.Security.CookieUsername)
- if len(uname) == 0 {
+ if uname == "" {
return false, nil
}
@@ -384,7 +384,7 @@ func SignUpPost(c *context.Context, cpt *captcha.Captcha, f form.Register) {
func Activate(c *context.Context) {
code := c.Query("code")
- if len(code) == 0 {
+ if code == "" {
c.Data["IsActivatePage"] = true
if c.User.IsActive {
c.NotFound()
@@ -515,7 +515,7 @@ func ResetPasswd(c *context.Context) {
c.Title("auth.reset_password")
code := c.Query("code")
- if len(code) == 0 {
+ if code == "" {
c.NotFound()
return
}
@@ -528,7 +528,7 @@ func ResetPasswdPost(c *context.Context) {
c.Title("auth.reset_password")
code := c.Query("code")
- if len(code) == 0 {
+ if code == "" {
c.NotFound()
return
}