< Summary

Information
Class: Syki.Daemon.Tasks.SendResetPasswordEmailHandler
Assembly: Daemon
File(s): /home/runner/work/syki/syki/Daemon/Tasks/SendResetPasswordEmailHandler.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 18
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Handle()100%11100%

File(s)

/home/runner/work/syki/syki/Daemon/Tasks/SendResetPasswordEmailHandler.cs

#LineLine coverage
 1using Syki.Daemon.Emails;
 2using Syki.Back.Features.Cross.SendResetPasswordToken;
 3
 4namespace Syki.Daemon.Tasks;
 5
 1916public class SendResetPasswordEmailHandler(SykiDbContext ctx, IEmailsService emailsService) : ISykiTaskHandler<SendReset
 7{
 8    public async Task Handle(SendResetPasswordEmail task)
 9    {
 19110        var user = await ctx.Users.AsNoTracking().FirstAsync(u => u.Id == task.UserId);
 11
 19112        var reset = await ctx.ResetPasswordTokens
 19113            .OrderByDescending(r => r.CreatedAt)
 19114            .FirstAsync(r => r.UserId == user.Id);
 15
 19116        await emailsService.SendResetPasswordEmail(user.Email, reset.Id.ToString());
 19117    }
 18}