heroiclabs / nakama-dart

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

Check if refreshToken is null #63

Closed RafaelBarbosatec closed 10 months ago

RafaelBarbosatec commented 1 year ago

I don’t know se set this default value is the best way to do this. But the problem is that running this package in flutter web the field refreshToken is null. The problem is at line 49 of Session.dart :

final refreshToken = JwtDecoder.decode(session.refreshToken!);
lukeskinner commented 11 months ago

I'm getting a similar exception being thrown trying to call authenticateEmail. When I've looked into it, it's expecting to find "refreshtoken" in the json but when I look at the http response it's actually "refresh_token".

Looking at the C# implementation from nakama it uses refresh_token - https://github.com/heroiclabs/nakama-dotnet/blob/master/Nakama/ApiClient.gen.cs#L2313

CLAassistant commented 10 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


rafaelbarbsoatec seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

obrunsmann commented 10 months ago

Hey @RafaelBarbosatec, thank you for your contribution. I fixed the issue about the wrong mapping of refreshToken field in the latest commit in develop branch. The problem actually was the different casing of the real API response and the documented values in the swagger file.

I am going to release a new version in the next days with the fix.