updated otp request error message

This commit is contained in:
Gani Georgiev 2024-11-26 19:50:26 +02:00
parent 6e26cb5d88
commit cb2b27f6ed
1 changed files with 2 additions and 2 deletions

View File

@ -49,12 +49,12 @@ func recordRequestOTP(e *core.RequestEvent) error {
return e.App.OnRecordRequestOTPRequest().Trigger(event, func(e *core.RecordCreateOTPRequestEvent) error { return e.App.OnRecordRequestOTPRequest().Trigger(event, func(e *core.RecordCreateOTPRequestEvent) error {
if e.Record == nil { if e.Record == nil {
// write a dummy 200 response as a very rudimentary user emails enumeration protection // write a dummy 200 response as a very rudimentary emails enumeration "protection"
e.JSON(http.StatusOK, map[string]string{ e.JSON(http.StatusOK, map[string]string{
"otpId": core.GenerateDefaultRandomId(), "otpId": core.GenerateDefaultRandomId(),
}) })
return fmt.Errorf("failed to fetch %s record with email %s: %w", collection.Name, form.Email, err) return fmt.Errorf("missing or invalid %s OTP auth record with email %s", collection.Name, form.Email)
} }
var otp *core.OTP var otp *core.OTP