aboutsummaryrefslogtreecommitdiff
path: root/internal/route/user
diff options
context:
space:
mode:
Diffstat (limited to 'internal/route/user')
-rw-r--r--internal/route/user/auth.go8
-rw-r--r--internal/route/user/setting.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/route/user/auth.go b/internal/route/user/auth.go
index 38751cb6..213ff050 100644
--- a/internal/route/user/auth.go
+++ b/internal/route/user/auth.go
@@ -60,7 +60,7 @@ func AutoLogin(c *context.Context) (bool, error) {
return false, nil
}
- if val, ok := c.GetSuperSecureCookie(u.Rands+u.Passwd, conf.Security.CookieRememberName); !ok || val != u.Name {
+ if val, ok := c.GetSuperSecureCookie(u.Rands+u.Password, conf.Security.CookieRememberName); !ok || val != u.Name {
return false, nil
}
@@ -122,7 +122,7 @@ func afterLogin(c *context.Context, u *db.User, remember bool) {
if remember {
days := 86400 * conf.Security.LoginRememberDays
c.SetCookie(conf.Security.CookieUsername, u.Name, days, conf.Server.Subpath, "", conf.Security.CookieSecure, true)
- c.SetSuperSecureCookie(u.Rands+u.Passwd, conf.Security.CookieRememberName, u.Name, days, conf.Server.Subpath, "", conf.Security.CookieSecure, true)
+ c.SetSuperSecureCookie(u.Rands+u.Password, conf.Security.CookieRememberName, u.Name, days, conf.Server.Subpath, "", conf.Security.CookieSecure, true)
}
_ = c.Session.Set("uid", u.ID)
@@ -334,7 +334,7 @@ func SignUpPost(c *context.Context, cpt *captcha.Captcha, f form.Register) {
u := &db.User{
Name: f.UserName,
Email: f.Email,
- Passwd: f.Password,
+ Password: f.Password,
IsActive: !conf.Auth.RequireEmailConfirmation,
}
if err := db.CreateUser(u); err != nil {
@@ -544,7 +544,7 @@ func ResetPasswdPost(c *context.Context) {
return
}
- u.Passwd = passwd
+ u.Password = passwd
var err error
if u.Rands, err = db.GetUserSalt(); err != nil {
c.Error(err, "get user salt")
diff --git a/internal/route/user/setting.go b/internal/route/user/setting.go
index 66e3ace2..8c0e87c1 100644
--- a/internal/route/user/setting.go
+++ b/internal/route/user/setting.go
@@ -202,7 +202,7 @@ func SettingsPasswordPost(c *context.Context, f form.ChangePassword) {
} else if f.Password != f.Retype {
c.Flash.Error(c.Tr("form.password_not_match"))
} else {
- c.User.Passwd = f.Password
+ c.User.Password = f.Password
var err error
if c.User.Salt, err = db.GetUserSalt(); err != nil {
c.Errorf(err, "get user salt")