chore: Update environment variables for beta and production environments

This commit is contained in:
Frederico Santos 2024-07-10 21:33:35 +01:00
parent cf1e457edc
commit cbf9bdba46
6 changed files with 18 additions and 10 deletions

View File

@ -1,3 +1,5 @@
VITE_BYPASS_LOGIN=0
VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=https://api.beta.pokerogue.net
VITE_SERVER_URL=https://api.beta.pokerogue.net
VITE_DISCORD_CLIENT_ID=1248062921129459756
VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com

View File

@ -1,3 +1,5 @@
VITE_BYPASS_LOGIN=0
VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=https://api.pokerogue.net
VITE_SERVER_URL=https://api.pokerogue.net
VITE_DISCORD_CLIENT_ID=1248062921129459756
VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com

View File

@ -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");

View File

@ -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) {

View File

@ -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);

View File

@ -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");