< Summary

Information
Class: Syki.Back.Features.Academic.CrossLogin.CrossLoginService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CrossLogin/CrossLoginService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 19
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/CrossLogin/CrossLoginService.cs

#LineLine coverage
 1using Syki.Back.Features.Cross.GenerateJWT;
 2
 3namespace Syki.Back.Features.Academic.CrossLogin;
 4
 45public class CrossLoginService(SykiDbContext ctx, GenerateJWTService service) : IAcademicService
 6{
 7    public async Task<OneOf<CrossLoginOut, SykiError>> Login(Guid institutionId, CrossLoginIn data)
 8    {
 49        var targetUser = await ctx.Users.AsNoTracking()
 410            .Where(c => c.InstitutionId == institutionId && c.Id == data.TargetUserId)
 411            .FirstOrDefaultAsync();
 12
 613        if (targetUser == null) return new UserNotFound();
 14
 215        var token = await service.Generate(targetUser.Email);
 16
 217        return new CrossLoginOut { AccessToken = token };
 418    }
 19}