heroiclabs / nakama-dart

Pure Dart Client for Nakama Server
https://heroiclabs.com/docs/nakama/client-libraries/dart
157 stars 48 forks source link

Session Expired Bug #90

Closed aaronren closed 4 months ago

aaronren commented 5 months ago

Describe the bug Session always expired.

Reproduction Code I found "expiresAt" and "refreshExpiresAt" is not parsed correct, in the function "Session.fromDto" in the file "session.dart".

expiresAt: DateTime.fromMillisecondsSinceEpoch(
  token['exp'] as int,
),
refreshExpiresAt: DateTime.fromMillisecondsSinceEpoch(
  refreshToken['exp'] as int,
),

It should be the same like codes in the function "Session.fromApi":

expiresAt: DateTime.fromMillisecondsSinceEpoch(
  (token['exp'] as int) * 1000,
),
refreshExpiresAt: DateTime.fromMillisecondsSinceEpoch(
  (refreshToken['exp'] as int) * 1000,
),
meganide commented 5 months ago

Also have this problem. Please fix asap.

trey-a-hope commented 5 months ago

Same problem here. I was wondering why my session was always expired after a fresh authentication.

meganide commented 5 months ago

Same problem here. I was wondering why my session was always expired after a fresh authentication.

I saw that the fix has been merged in the next version release (1.0.6). I wonder when that will be release though.

obrunsmann commented 4 months ago

Release process started. Fixed from 1.0.6

You could use the release branch in the meantime if you want