< Summary

Information
Class: Syki.Back.Features.Cross.Login.LoginService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Cross/Login/LoginService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 27
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
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%66100%

File(s)

/home/runner/work/syki/syki/Back/Features/Cross/Login/LoginService.cs

#LineLine coverage
 1using Syki.Back.Features.Cross.CreateUser;
 2using Syki.Back.Features.Cross.GenerateJWT;
 3
 4namespace Syki.Back.Features.Cross.Login;
 5
 3876public class LoginService(GenerateJWTService service, SignInManager<SykiUser> signInManager) : ICrossService
 7{
 8    public async Task<LoginOut> Login(LoginIn data)
 9    {
 38710        var result = await signInManager.PasswordSignInAsync(
 38711            userName: data.Email,
 38712            password: data.Password,
 38713            isPersistent: false,
 38714            lockoutOnFailure: false
 38715        );
 16
 38717        if (!result.Succeeded && !result.RequiresTwoFactor)
 418            return new LoginOut { WrongEmailOrPassword = true };
 19
 38320        if (result.RequiresTwoFactor)
 321            return new LoginOut { RequiresTwoFactor = true };
 22
 38023        var jwt = await service.Generate(data.Email);
 24
 38025        return new LoginOut { AccessToken = jwt };
 38726    }
 27}