diff --git a/src/OpenBanking.Library.Connector/Models/Persistent/BaseConsent.cs b/src/OpenBanking.Library.Connector/Models/Persistent/BaseConsent.cs index a1d33e63..c31ba293 100644 --- a/src/OpenBanking.Library.Connector/Models/Persistent/BaseConsent.cs +++ b/src/OpenBanking.Library.Connector/Models/Persistent/BaseConsent.cs @@ -155,6 +155,21 @@ protected BaseConsent( _accessTokenModified, _accessTokenModifiedBy); + public void UpdateAccessToken( + string? accessTokenValue, + int accessTokenExpiresIn, + string? accessTokenRefreshToken, + DateTimeOffset modified, + string? modifiedBy) + + { + _accessTokenAccessToken = accessTokenValue; + _accessTokenExpiresIn = accessTokenExpiresIn; + _accessTokenRefreshToken = accessTokenRefreshToken; + _accessTokenModified = modified; + _accessTokenModifiedBy = modifiedBy; + } + public void UpdateAuthContext(string state, string nonce, DateTimeOffset modified, string? modifiedBy) { AuthContextState = state; diff --git a/src/OpenBanking.Library.Connector/Models/Persistent/Cleanup/AccountAndTransaction/AccountAccessConsentCleanup.cs b/src/OpenBanking.Library.Connector/Models/Persistent/Cleanup/AccountAndTransaction/AccountAccessConsentCleanup.cs index 0f12846f..7d10942a 100644 --- a/src/OpenBanking.Library.Connector/Models/Persistent/Cleanup/AccountAndTransaction/AccountAccessConsentCleanup.cs +++ b/src/OpenBanking.Library.Connector/Models/Persistent/Cleanup/AccountAndTransaction/AccountAccessConsentCleanup.cs @@ -96,6 +96,8 @@ public async Task Cleanup( null); await refreshTokenEntityMethods.AddAsync(accountAccessConsentRefreshToken); } + + accountAccessConsent.UpdateAccessToken(null, 0, null, DateTimeOffset.UtcNow, createdBy); } } }