Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete Session Restore #207

Open
kevyntime opened this issue Apr 12, 2024 · 1 comment · May be fixed by #208
Open

Incomplete Session Restore #207

kevyntime opened this issue Apr 12, 2024 · 1 comment · May be fixed by #208

Comments

@kevyntime
Copy link

I am running into a problem with session management in the Godot 4 client library that seems inconsistent with the session restoration and refresh token handling in other libraries, such as Unity and Unreal.

After authentication, both the auth_token and refresh_token are present, and I save them locally on the user's device. According to the session lifecycle documentation at Nakama Godot Client Library Docs, using NakamaClient.restore_session(auth_token) should restore a session. However, this method returns a NakamaSession instance without a refresh_token. If the session is expired, the next part of the example await client.session_refresh_async(session) fails with a Refresh token is required error.

Based on the body of the restore_session function and the counterpart functions in other client libraries, to workaround this, I've directly instantiated the session with both tokens: var session = NakamaSession.new(auth_token, refresh_token). This approach seems to work correctly.

Am I headed in the right direction with this or is it not meant to work this way? I've just started with Nakama and multiplayer in general, so I'm not really certain what to expect or look for.

@lugehorsam
Copy link
Contributor

Hey @kevyntime you are absolutely right -- could you submit a PR to our SDK with a new NakamaClient.restore_session(auth_token, refresh_token) method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants