mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 05:44:04 +08:00
Merge 51365d066c9eb2955e2e974bb2028242b1089b97 into 88abb323cb8e596e8053ce57f890dcc7286fe012
This commit is contained in:
commit
8fbc8fd37e
@ -60,6 +60,10 @@ func (u *User) IsAdmin() bool {
|
||||
return u.Role == ADMIN
|
||||
}
|
||||
|
||||
func (u *User) IsOtpEnabled() bool {
|
||||
return u.OtpSecret != ""
|
||||
}
|
||||
|
||||
func (u *User) ValidateRawPassword(password string) error {
|
||||
return u.ValidatePwdStaticHash(StaticHash(password))
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ func WebDAVAuth(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
user, err := op.GetUserByName(username)
|
||||
if err != nil || user.ValidateRawPassword(password) != nil {
|
||||
if err != nil || user.IsOtpEnabled() || user.ValidateRawPassword(password) != nil {
|
||||
if c.Request.Method == "OPTIONS" {
|
||||
c.Set("user", guest)
|
||||
c.Next()
|
||||
|
Loading…
x
Reference in New Issue
Block a user