mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-10 06:19:04 +08:00
fix: removes password validations other than length (#1909)
This commit is contained in:
parent
09af6c262c
commit
02898d14f9
@ -2,9 +2,7 @@ package auth
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.signoz.io/signoz/pkg/query-service/constants"
|
"go.signoz.io/signoz/pkg/query-service/constants"
|
||||||
@ -74,21 +72,21 @@ func ValidatePassword(password string) error {
|
|||||||
return errors.Errorf("Password should be atleast %d characters.", minimumPasswordLength)
|
return errors.Errorf("Password should be atleast %d characters.", minimumPasswordLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
num := `[0-9]{1}`
|
// num := `[0-9]{1}`
|
||||||
lower := `[a-z]{1}`
|
// lower := `[a-z]{1}`
|
||||||
upper := `[A-Z]{1}`
|
// upper := `[A-Z]{1}`
|
||||||
symbol := `[!@#$&*]{1}`
|
// symbol := `[!@#$&*]{1}`
|
||||||
if b, err := regexp.MatchString(num, password); !b || err != nil {
|
// if b, err := regexp.MatchString(num, password); !b || err != nil {
|
||||||
return fmt.Errorf("password should have atleast one number")
|
// return fmt.Errorf("password should have atleast one number")
|
||||||
}
|
// }
|
||||||
if b, err := regexp.MatchString(lower, password); !b || err != nil {
|
// if b, err := regexp.MatchString(lower, password); !b || err != nil {
|
||||||
return fmt.Errorf("password should have atleast one lower case letter")
|
// return fmt.Errorf("password should have atleast one lower case letter")
|
||||||
}
|
// }
|
||||||
if b, err := regexp.MatchString(upper, password); !b || err != nil {
|
// if b, err := regexp.MatchString(upper, password); !b || err != nil {
|
||||||
return fmt.Errorf("password should have atleast one upper case letter")
|
// return fmt.Errorf("password should have atleast one upper case letter")
|
||||||
}
|
// }
|
||||||
if b, err := regexp.MatchString(symbol, password); !b || err != nil {
|
// if b, err := regexp.MatchString(symbol, password); !b || err != nil {
|
||||||
return fmt.Errorf("password should have atleast one special character from !@#$&* ")
|
// return fmt.Errorf("password should have atleast one special character from !@#$&* ")
|
||||||
}
|
// }
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user