public Task <ApplicationJwtRefreshToken> ExtractTokenAsync(string guid, CancellationToken cancellationToken) { string prefix = nameof(ExtractTokenAsync) + Constants.FNSUFFIX; ApplicationJwtRefreshToken token = null; try { using (var tokensDAL = new AspNetTokensDAL(_connStr)) { token = tokensDAL.SelectByGuid(guid); if (token != null) { tokensDAL.Delete(guid); } } } catch (Exception ex) { _logger.LogError(prefix + $"Exception:[{ex.ToString()}]"); } return(Task.FromResult(token)); }
public Task <IdentityResult> DeleteAsync(string guid, CancellationToken cancellationToken) { try { using (var tokensDAL = new AspNetTokensDAL(_connStr)) { tokensDAL.Delete(guid); } } catch (Exception ex) { List <IdentityError> idErrors = new List <IdentityError>(); IdentityError idError = new IdentityError { Description = ex.Message }; idErrors.Add(idError); return(Task.FromResult(IdentityResult.Failed(idErrors.ToArray()))); } return(Task.FromResult(IdentityResult.Success)); }