IntentArchitect / Support

A repository dedicated to handling issues and support queries
3 stars 0 forks source link

Intent.AspNetCore.Identity.AccountController is not 100% compatible with Postgres #70

Closed shainegordon closed 9 months ago

shainegordon commented 9 months ago

What happened?

ITokenService.GenerateRefreshToken returns a Tuple of (string Token, DateTime Expiry)

ApplicationIdentityUser.RefreshTokenExpired property returns a DateTime?

However, when you use Postgres, it will try to store these as timestamp with time zone

You'll get the following error

Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.

IMO, these return types and properties should be DateTimeOffset? or the module should have a setting to switch between these 2 types

What version of Intent Architect are you using?

4.0 and 4.1 beta

Additional information

For now, I have set my software factory to ignore changes to ITokenService, TokenSerivce, ApplicationIdentityUser and ApplicationIdentityUserConfiguration

joelsteventurner commented 9 months ago

Hi @shainegordon

I do have a pre-release fix out for this which you can try

Intent.AspNetCore.Identity.AccountController v2.1.3-pre0

The fix was to make the refresh time stamps work in UTC.

shainegordon commented 9 months ago

Hi @shainegordon

I do have a pre-release fix out for this which you can try

Intent.AspNetCore.Identity.AccountController v2.1.3-pre0

The fix was to make the refresh time stamps work in UTC.

Excellent, this seems to work, I have reverted my ignored files, and am still able to login :+1: