Skip to content

Commit 84086e7

Browse files
Clarify Unity WebGL token guard
1 parent 58bb889 commit 84086e7

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00300-part-2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,10 @@ public class GameManager : MonoBehaviour
755755
#if UNITY_WEBGL && !UNITY_EDITOR
756756
if (AuthToken.Token == "")
757757
{
758+
// No token was supplied to the connection, so this is the
759+
// long-lived server-issued token for the new identity. Save it.
760+
// If a token already exists, this connect may have used a
761+
// short-lived WebSocket token, which should not overwrite it.
758762
AuthToken.SaveToken(token);
759763
}
760764
#else

docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00400-part-3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,10 @@ Next lets add some callbacks when rows change in the database. Modify the `Handl
13671367
#if UNITY_WEBGL && !UNITY_EDITOR
13681368
if (AuthToken.Token == "")
13691369
{
1370+
// No token was supplied to the connection, so this is the
1371+
// long-lived server-issued token for the new identity. Save it.
1372+
// If a token already exists, this connect may have used a
1373+
// short-lived WebSocket token, which should not overwrite it.
13701374
AuthToken.SaveToken(token);
13711375
}
13721376
#else

0 commit comments

Comments
 (0)