Skip to content

Commit

Permalink
Update database cleanup to clear migrated fields
Browse files Browse the repository at this point in the history
  • Loading branch information
markm77 committed Jun 12, 2023
1 parent 58d65a7 commit 56ed365
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/OpenBanking.Library.Connector/Models/Persistent/BaseConsent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public async Task Cleanup(
null);
await refreshTokenEntityMethods.AddAsync(accountAccessConsentRefreshToken);
}

accountAccessConsent.UpdateAccessToken(null, 0, null, DateTimeOffset.UtcNow, createdBy);
}
}
}
Expand Down

0 comments on commit 56ed365

Please sign in to comment.