Exemplo n.º 1
0
        public Task <RefreshTokenModel> GetByRefTokenAsync(string refreshToken)
        {
            var dal = _tokenRepository.GetByRefTokenAsync(refreshToken);

            if (dal == null)
            {
                return(Task.FromResult <RefreshTokenModel>(null));
            }
            else
            {
                return(Task.FromResult(new RefreshTokenModel
                {
                    Id = dal.Id,
                    RefToken = dal.RefToken,
                    ClientId = dal.ClientId,
                    UserName = dal.UserName,
                    IssuedUtc = dal.IssuedUtc,
                    ExpiresUtc = dal.ExpiresUtc,
                    ProtectedTicket = dal.ProtectedTicket,
                    InsertedBy = dal.InsertedBy,
                    InsertedDate = dal.InsertedDate,
                    UpdatedBy = dal.UpdatedBy,
                    UpdatedDate = dal.UpdatedDate
                }));
            }
        }