diff --git a/internal/api/magic_link.go b/internal/api/magic_link.go index 2393059deb..9a6f5f5e42 100644 --- a/internal/api/magic_link.go +++ b/internal/api/magic_link.go @@ -84,7 +84,7 @@ func (a *API) MagicLink(w http.ResponseWriter, r *http.Request) error { if isNewUser { // User either doesn't exist or hasn't completed the signup process. // Sign them up with temporary password. - password := crypto.GeneratePassword(config.Password.RequiredCharacters, 33) + password := crypto.GeneratePassword(config.Password.RequiredCharacters, max(config.Password.MinLength, 33)) signUpParams := &SignupParams{ Email: params.Email, diff --git a/internal/api/otp.go b/internal/api/otp.go index 5f12b0bbe3..9f64be5b03 100644 --- a/internal/api/otp.go +++ b/internal/api/otp.go @@ -139,7 +139,7 @@ func (a *API) SmsOtp(w http.ResponseWriter, r *http.Request) error { if isNewUser { // User either doesn't exist or hasn't completed the signup process. // Sign them up with temporary password. - password, err := password.Generate(64, 10, 1, false, true) + password, err := password.Generate(max(config.Password.MinLength, 64), 10, 1, false, true) if err != nil { return apierrors.NewInternalServerError("error creating user").WithInternalError(err) }