Пример #1
0
        public async Task <TokenResponse> GetJwtSecurityToken(AuthServiceResult serviceResult)
        {
            if (serviceResult.UserSignIn.Succeeded && serviceResult.User != null)
            {
                var securityToken = await _tokenManager.GetJwtSecurityToken(serviceResult.User);

                return(new TokenResponse
                {
                    Token = new JwtSecurityTokenHandler().WriteToken(securityToken),
                    Expiration = securityToken.ValidTo
                });
            }
            return(null);
        }