This commit is contained in:
@@ -318,25 +318,25 @@ namespace AyaNova.Biz
|
||||
/////////////////////////////////////////////
|
||||
// GENERATE AND EMAIL Password reset code
|
||||
//
|
||||
internal async Task<bool> SendPasswordResetCode(long userId)
|
||||
internal async Task<uint> SendPasswordResetCode(long userId)
|
||||
{
|
||||
User dbObject = await ct.User.Include(o => o.UserOptions).FirstOrDefaultAsync(z => z.Id == userId);
|
||||
if (dbObject == null)
|
||||
{
|
||||
AddError(ApiErrorCode.NOT_FOUND);
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(dbObject.UserOptions.EmailAddress))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "EmailAddress");
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
var ServerUrl = ServerGlobalOpsSettingsCache.Notify.AyaNovaServerURL;
|
||||
if (string.IsNullOrWhiteSpace(ServerUrl))
|
||||
{
|
||||
await NotifyEventProcessor.AddOpsProblemEvent("User::SendPasswordResetCode - The OPS Notification setting is empty for AyaNova Server URL. This prevents Notification system from linking events to openable objects.");
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "ServerUrl", "Error: no server url configured in notification settings. Can't direct user to server for login. Set server URL and try again.");
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
var ResetCode = Hasher.GetRandomAlphanumericString(32);
|
||||
@@ -366,7 +366,7 @@ namespace AyaNova.Biz
|
||||
|
||||
//Log modification and save context
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified, "SendPasswordResetCode"), ct);
|
||||
return true;
|
||||
return dbObject.Concurrency;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user