mirror of
https://github.com/AlistGo/alist.git
synced 2025-12-19 02:50:06 +08:00
Merge 51365d066c into 3cddb6b7ed
This commit is contained in:
commit
ab847e1f75
@ -63,6 +63,10 @@ func (u *User) IsAdmin() bool {
|
||||
return u.Role.Contains(ADMIN)
|
||||
}
|
||||
|
||||
func (u *User) IsOtpEnabled() bool {
|
||||
return u.OtpSecret != ""
|
||||
}
|
||||
|
||||
func (u *User) ValidateRawPassword(password string) error {
|
||||
return u.ValidatePwdStaticHash(StaticHash(password))
|
||||
}
|
||||
|
||||
@ -95,7 +95,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…
Reference in New Issue
Block a user