Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 25376ab

Browse files
author
postables
committed
api/middleware: update authorizator to check both email & account stat
1 parent 5b5b408 commit 25376ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/middleware/jwt.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ func JwtConfigGenerate(jwtKey, realmName string, db *gorm.DB, l *zap.SugaredLogg
6262
if err != nil {
6363
return false
6464
}
65-
return usr.EmailEnabled
65+
if usr.EmailEnabled && usr.AccountEnabled {
66+
return true
67+
}
68+
return false
6669
},
6770
Unauthorized: func(c *gin.Context, code int, message string) {
6871
l.Error("invalid login detected")

0 commit comments

Comments
 (0)