updated otp request error message
This commit is contained in:
parent
6e26cb5d88
commit
cb2b27f6ed
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue