Exemple #1
0
        public async Task <UserDto> GetUserToken(string token)
        {
            JwtDto payload = _jwt.DecodeToken(token);

            var cache = _repositoryFacade.GetCache(payload.unique_name.ToString());

            if (cache == null)
            {
                User user = await _userManager.FindByEmailAsync(payload.unique_name.ToString());

                UserDto map = _mapper.Map <UserDto>(user);

                return(map);
            }

            UserDto userDto = JsonConvert.DeserializeObject <UserDto>(cache);

            return(userDto);
        }