Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

IPersistedGrantStore Kind of ConsumedTime is Unspecified. Intentional or not? #4708

Closed
rverberne opened this issue Aug 4, 2020 · 4 comments

Comments

@rverberne
Copy link

Hi, the method StoreAsync in implementation of IPersistedGrantStore is called with a PersistedGrant instance. When the ConsumedTime is given it's Kind is Unspecified, why? CreationTime and Expiration have Utc.

public async Task StoreAsync(PersistedGrant grant) {     
    // This is what i now do
    DateTime databaseValueToStore = grant.ConsumedTime is { }
        ? DateTime.SpecifyKind(grant.ConsumedTime.Value, DateTimeKind.Utc)
        : (DateTime?)null;
}
@brockallen brockallen self-assigned this Aug 5, 2020
@brockallen brockallen added this to the 4.0.5 milestone Sep 7, 2020
@brockallen
Copy link
Member

Huh odd -- the call to Clock.UtcNow which is the system clock from ASP.NET returns that. I'll have to adjust their value.

@brockallen
Copy link
Member

Ahh, it's a DateTimeOffset -- that's why. I will fix.

@brockallen
Copy link
Member

PR submitted. thx!

@leastprivilege leastprivilege removed this from the 4.1.0 milestone Sep 14, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants