WebClient shares: replace basic auth with a login form

basic auth will continue to work for REST API

Fixes #1166

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-02-12 08:29:53 +01:00
parent a3d0cf5ddf
commit 7e85356325
15 changed files with 411 additions and 64 deletions

View File

@@ -273,14 +273,11 @@ func (s *Share) validate() error {
}
// CheckCredentials verifies the share credentials if a password if set
func (s *Share) CheckCredentials(username, password string) (bool, error) {
func (s *Share) CheckCredentials(password string) (bool, error) {
if s.Password == "" {
return true, nil
}
if username == "" || password == "" {
return false, ErrInvalidCredentials
}
if username != s.Username {
if password == "" {
return false, ErrInvalidCredentials
}
if strings.HasPrefix(s.Password, bcryptPwdPrefix) {