diff --git a/.env.beta b/.env.beta index 8d1e93b3277..3f23d53ea3e 100644 --- a/.env.beta +++ b/.env.beta @@ -1,3 +1,5 @@ VITE_BYPASS_LOGIN=0 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=https://api.beta.pokerogue.net \ No newline at end of file +VITE_SERVER_URL=https://api.beta.pokerogue.net +VITE_DISCORD_CLIENT_ID=1248062921129459756 +VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com \ No newline at end of file diff --git a/.env.production b/.env.production index 74818d41a12..4d4d8a3aaf3 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,5 @@ VITE_BYPASS_LOGIN=0 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=https://api.pokerogue.net \ No newline at end of file +VITE_SERVER_URL=https://api.pokerogue.net +VITE_DISCORD_CLIENT_ID=1248062921129459756 +VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com \ No newline at end of file diff --git a/src/phases.ts b/src/phases.ts index c34889be8f3..c9f9c3c31b2 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -131,12 +131,12 @@ export class LoginPhase extends Phase { ] }); }, () => { - const redirectUri = encodeURIComponent(`${Utils.serverUrl}/auth/discord/callback`); + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/discord/callback`); const discordId = import.meta.env.VITE_DISCORD_CLIENT_ID; const discordUrl = `https://discord.com/api/oauth2/authorize?client_id=${discordId}&redirect_uri=${redirectUri}&response_type=code&scope=identify`; window.open(discordUrl, "_self"); }, () => { - const redirectUri = encodeURIComponent(`${Utils.serverUrl}/auth/google/callback`); + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/google/callback`); const googleId = import.meta.env.VITE_GOOGLE_CLIENT_ID; const googleUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${googleId}&redirect_uri=${redirectUri}&response_type=code&scope=openid`; window.open(googleUrl, "_self"); diff --git a/src/test/utils/mocks/mocksContainer/mockText.ts b/src/test/utils/mocks/mocksContainer/mockText.ts index 1dd440fde7c..f4513e20926 100644 --- a/src/test/utils/mocks/mocksContainer/mockText.ts +++ b/src/test/utils/mocks/mocksContainer/mockText.ts @@ -8,6 +8,7 @@ export default class MockText { private textureManager; public list = []; public style; + public text = ""; constructor(textureManager, x, y, content, styleOptions) { this.scene = textureManager.scene; @@ -17,6 +18,8 @@ export default class MockText { // Phaser.GameObjects.Text.prototype.updateText = () => null; // Phaser.Textures.TextureManager.prototype.addCanvas = () => {}; UI.prototype.showText = this.showText; + this.text = ""; + this.phaserText = ""; // super(scene, x, y); // this.phaserText = new Phaser.GameObjects.Text(scene, x, y, content, styleOptions); } @@ -150,7 +153,8 @@ export default class MockText { setText(text) { // Sets the text this Game Object will display. - // return this.phaserText.setText(text); + // return this.phaserText.setText\(text); + this.text = text; } setAngle(angle) { diff --git a/src/ui/login-form-ui-handler.ts b/src/ui/login-form-ui-handler.ts index 810f4a0e754..2a4f419cbbc 100644 --- a/src/ui/login-form-ui-handler.ts +++ b/src/ui/login-form-ui-handler.ts @@ -34,7 +34,7 @@ export default class LoginFormUiHandler extends FormModalUiHandler { googleImage.setInteractive(); googleImage.setName("google-icon"); googleImage.on("pointerdown", () => { - const redirectUri = encodeURIComponent(`${Utils.serverUrl}/auth/google/callback`); + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/google/callback`); const googleId = import.meta.env.VITE_GOOGLE_CLIENT_ID; const googleUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${googleId}&redirect_uri=${redirectUri}&response_type=code&scope=openid`; window.open(googleUrl, "_self"); @@ -47,7 +47,7 @@ export default class LoginFormUiHandler extends FormModalUiHandler { discordImage.setInteractive(); discordImage.setName("discord-icon"); discordImage.on("pointerdown", () => { - const redirectUri = encodeURIComponent(`${Utils.serverUrl}/auth/discord/callback`); + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/discord/callback`); const discordId = import.meta.env.VITE_DISCORD_CLIENT_ID; const discordUrl = `https://discord.com/api/oauth2/authorize?client_id=${discordId}&redirect_uri=${redirectUri}&response_type=code&scope=identify`; window.open(discordUrl, "_self"); @@ -152,7 +152,7 @@ export default class LoginFormUiHandler extends FormModalUiHandler { } processExternalProvider() : void { - this.externalPartyTitle.setText(i18next.t("menu:orUse")); + this.externalPartyTitle.setText(i18next.t("menu:orUse") ?? ""); this.externalPartyTitle.setX(20+this.externalPartyTitle.text.length); this.externalPartyTitle.setVisible(true); this.externalPartyContainer.setPositionRelative(this.modalContainer, 175, 0); diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 782498e03de..3bfbb3576cc 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -339,7 +339,7 @@ export default class MenuUiHandler extends MessageUiHandler { handler: () => { if (loggedInUser?.discordId === "") { const token = Utils.getCookie(Utils.sessionIdKey); - const redirectUri = encodeURIComponent(`${Utils.serverUrl}/auth/discord/callback`); + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/discord/callback`); const discordId = import.meta.env.VITE_DISCORD_CLIENT_ID; const discordUrl = `https://discord.com/api/oauth2/authorize?client_id=${discordId}&redirect_uri=${redirectUri}&response_type=code&scope=identify&state=${token}`; window.open(discordUrl, "_self"); @@ -360,7 +360,7 @@ export default class MenuUiHandler extends MessageUiHandler { handler: () => { if (loggedInUser?.googleId === "") { const token = Utils.getCookie(Utils.sessionIdKey); - const redirectUri = encodeURIComponent(`${Utils.serverUrl}/auth/google/callback`); + const redirectUri = encodeURIComponent(`${import.meta.env.VITE_SERVER_URL}/auth/google/callback`); const googleId = import.meta.env.VITE_GOOGLE_CLIENT_ID; const googleUrl = `https://accounts.google.com/o/oauth2/auth?client_id=${googleId}&response_type=code&redirect_uri=${redirectUri}&scope=openid&state=${token}`; window.open(googleUrl, "_self");