heroiclabs / nakama-dart

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

Fix parsing session expiry #82

Closed ilmalte closed 5 months ago

ilmalte commented 6 months ago

The commit b75e60e didn't entirely solve the issue #73.

as @Dragon863 pointed out in the issue:

the timestamps for the session expiry seem to be reported incorrectly (at some point in 1970), I believe this is because in session.dart fromMillisecondsSinceEpoch is being called on the decoded token which stores the token in seconds since epoch. Whilst this can be worked around by changing the arguments to (token['exp'] as int) * 1000 in every line where this function is called in the file.

The factory constructor fromDto accepts a parameter session containing a token field given by the Nakama backend. The exact same token will be passed as a field in the parameter session of the factory constructor fromApi.

For this reason I expect the factory constructor fromDto to be changed like it has been done for the fromApi.

CLAassistant commented 6 months ago

CLA assistant check
All committers have signed the CLA.

martemorfosis commented 5 months ago

@obrunsmann Any chance to get this merged anytime soon?

obrunsmann commented 5 months ago

Done, fixed a syntax error

meganide commented 5 months ago

This is still not merged in the latest version (1.0.5). Could it get merged asap please @obrunsmann ?