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

Commit

Permalink
api/middleware: update authorizator to check both email & account stat
Browse files Browse the repository at this point in the history
  • Loading branch information
postables committed Apr 18, 2020
1 parent 5b5b408 commit 25376ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/middleware/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ func JwtConfigGenerate(jwtKey, realmName string, db *gorm.DB, l *zap.SugaredLogg
if err != nil {
return false
}
return usr.EmailEnabled
if usr.EmailEnabled && usr.AccountEnabled {
return true
}
return false
},
Unauthorized: func(c *gin.Context, code int, message string) {
l.Error("invalid login detected")
Expand Down

0 comments on commit 25376ab

Please sign in to comment.