Quellcode durchsuchen

fix bug when user login and want to resend register confirmation email (#6482)

tags/v1.9.0-rc1
Lunny Xiao vor 5 Jahren
Ursprung
Commit
ef2a343e27
2 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen
  1. 6
    6
      models/login_source.go
  2. 1
    1
      routers/routes/routes.go

+ 6
- 6
models/login_source.go Datei anzeigen

return nil, err return nil, err
} }


if !user.IsActive {
return nil, ErrUserInactive{user.ID, user.Name}
} else if user.ProhibitLogin {
// WARN: DON'T check user.IsActive, that will be checked on reqSign so that
// user could be hint to resend confirm email.
if user.ProhibitLogin {
return nil, ErrUserProhibitLogin{user.ID, user.Name} return nil, ErrUserProhibitLogin{user.ID, user.Name}
} }


switch user.LoginType { switch user.LoginType {
case LoginNoType, LoginPlain, LoginOAuth2: case LoginNoType, LoginPlain, LoginOAuth2:
if user.IsPasswordSet() && user.ValidatePassword(password) { if user.IsPasswordSet() && user.ValidatePassword(password) {
if !user.IsActive {
return nil, ErrUserInactive{user.ID, user.Name}
} else if user.ProhibitLogin {
// WARN: DON'T check user.IsActive, that will be checked on reqSign so that
// user could be hint to resend confirm email.
if user.ProhibitLogin {
return nil, ErrUserProhibitLogin{user.ID, user.Name} return nil, ErrUserProhibitLogin{user.ID, user.Name}
} }



+ 1
- 1
routers/routes/routes.go Datei anzeigen



m.Group("/user", func() { m.Group("/user", func() {
// r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds) // r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
m.Any("/activate", user.Activate)
m.Any("/activate", user.Activate, reqSignIn)
m.Any("/activate_email", user.ActivateEmail) m.Any("/activate_email", user.ActivateEmail)
m.Get("/email2user", user.Email2User) m.Get("/email2user", user.Email2User)
m.Get("/forgot_password", user.ForgotPasswd) m.Get("/forgot_password", user.ForgotPasswd)

Laden…
Abbrechen
Speichern