Skip to content

Commit

Permalink
forward existing token during OAuth for upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Dec 22, 2023
1 parent 9ad16b2 commit 06986f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "colyseus.js",
"version": "0.15.15-preview.21",
"version": "0.15.15-preview.22",
"description": "Colyseus Multiplayer SDK for JavaScript/TypeScript",
"author": "Endel Dreyer",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion src/Auth.ts
Expand Up @@ -114,9 +114,12 @@ export class Auth {
const w = settings.width || 480;
const h = settings.height || 768;

// forward existing token for upgrading
const upgradingToken = this.token ? `?token=${this.token}` : "";

// Capitalize first letter of providerName
const title = `Login with ${(providerName[0].toUpperCase() + providerName.substring(1))}`;
const url = this.http['client']['getHttpEndpoint'](`${(settings.prefix || `${this.settings.path}/provider`)}/${providerName}`);
const url = this.http['client']['getHttpEndpoint'](`${(settings.prefix || `${this.settings.path}/provider`)}/${providerName}${upgradingToken}`);

const left = (screen.width / 2) - (w / 2);
const top = (screen.height / 2) - (h / 2);
Expand Down

0 comments on commit 06986f2

Please sign in to comment.