aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-04-02 13:44:33 +0800
committerLauris BH <lauris@nix.lv>2019-04-02 08:44:33 +0300
commitef2a343e27d8af2de0bb696bd60d9a019e1e8b69 (patch)
tree0c681f1fffbd8f995ec68e13b86f5d2e7eef8168 /models
parentb04a1d9d639a285db6c3fb9fd675ccb22a04fd14 (diff)
downloadgitea-ef2a343e27d8af2de0bb696bd60d9a019e1e8b69.tar.gz
gitea-ef2a343e27d8af2de0bb696bd60d9a019e1e8b69.zip
fix bug when user login and want to resend register confirmation email (#6482)
Diffstat (limited to 'models')
-rw-r--r--models/login_source.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/models/login_source.go b/models/login_source.go
index b481cb4dbf..69602b8b16 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -616,9 +616,9 @@ func ExternalUserLogin(user *User, login, password string, source *LoginSource,
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}
}
@@ -658,9 +658,9 @@ func UserSignIn(username, password string) (*User, error) {
switch user.LoginType {
case LoginNoType, LoginPlain, LoginOAuth2:
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}
}