1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-12-05 18:24:11 +02:00

updated LastVerificationSentAt and LastResetSentAt fill sequence

This commit is contained in:
Gani Georgiev
2023-08-17 14:03:11 +03:00
parent c8ef3c4050
commit 53b20ec104
7 changed files with 17 additions and 15 deletions

View File

@@ -82,9 +82,6 @@ func (form *RecordVerificationRequest) Submit(interceptors ...InterceptorFunc[*m
if (now.Sub(lastVerificationSentAt)).Seconds() < form.resendThreshold {
return errors.New("A verification email was already sent.")
}
// update last sent timestamp
record.SetLastVerificationSentAt(types.NowDateTime())
}
return runInterceptors(record, func(m *models.Record) error {
@@ -96,6 +93,9 @@ func (form *RecordVerificationRequest) Submit(interceptors ...InterceptorFunc[*m
return err
}
// update last sent timestamp
m.SetLastVerificationSentAt(types.NowDateTime())
return form.dao.SaveRecord(m)
}, interceptors...)
}