Пример #1
0
        public virtual async Task <UserJwtToken> SaveUserJwtTokenAsync(UserJwtTokenDto userJwtTokenDto)
        {
            var tokenHash = HashToken(userJwtTokenDto.AccessToken);

            var userJwtToken = new UserJwtToken
            {
                AccessTokenHash            = tokenHash,
                AccessTokenExpiresDateTime = userJwtTokenDto.AccessTokenExpiresDateTime,
                TokenPlatform = userJwtTokenDto.TokenPlatform,
                UserId        = await UserService.GetUserIdByUserNameAsync(userJwtTokenDto.UserName)
            };

            return(await UserJwtTokenRepository.AddAsync(userJwtToken));
        }
Пример #2
0
        public virtual async Task <UserJwtToken> SaveJwtTokenAsync(UserJwtTokenDto userJwtTokenDto)
        {
            var accessToken = await HashToken(userJwtTokenDto.AccessToken);

            var userJwtToken = new UserJwtToken
            {
                AccessToken = accessToken,
                AccessTokenExpireDateTime = userJwtTokenDto.AccessTokenExpireDateTime,
                Platform = userJwtTokenDto.TokenPlatform,
                UserId   = await UserService.GetUserIdAsync(userJwtTokenDto.Username)
            };

            return(await UserJwtTokenRepository.AddAsync(userJwtToken));
        }
Пример #3
0
 public virtual async Task DeleteUserJwtTokenAsync(UserJwtToken userJwtToken)
 => await UserJwtTokenRepository.DeleteAsync(userJwtToken);