apply textures on openid login, fix pusher errors on woka list (#1961)
* apply textures on openid login, fix pusher errors on woka list * remove logging * Returning a HTTP 400 id roomUrl parameter not set Co-authored-by: David Négrier <d.negrier@thecodingmachine.com>
This commit is contained in:
@@ -330,9 +330,12 @@ class ConnectionManager {
|
||||
throw new Error("No Auth code provided");
|
||||
}
|
||||
}
|
||||
const { authToken, userUuid, email, username, locale } = await Axios.get(`${PUSHER_URL}/login-callback`, {
|
||||
params: { code, nonce, token, playUri: this.currentRoom?.key },
|
||||
}).then((res) => {
|
||||
const { authToken, userUuid, email, username, locale, textures } = await Axios.get(
|
||||
`${PUSHER_URL}/login-callback`,
|
||||
{
|
||||
params: { code, nonce, token, playUri: this.currentRoom?.key },
|
||||
}
|
||||
).then((res) => {
|
||||
return res.data;
|
||||
});
|
||||
localUserStore.setAuthToken(authToken);
|
||||
@@ -361,6 +364,18 @@ class ConnectionManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (textures) {
|
||||
const layers: string[] = [];
|
||||
for (const texture of textures) {
|
||||
if (texture !== undefined) {
|
||||
layers.push(texture.id);
|
||||
}
|
||||
}
|
||||
if (layers.length > 0) {
|
||||
gameManager.setCharacterLayers(layers);
|
||||
}
|
||||
}
|
||||
|
||||
//user connected, set connected store for menu at true
|
||||
userIsConnected.set(true);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export class CustomizeScene extends AbstractCharacterScene {
|
||||
// FIXME: window.location.href is wrong. We need the URL of the main room (so we need to apply any redirect before!)
|
||||
this.load.json(
|
||||
wokaMetadataKey,
|
||||
`${PUSHER_URL}/woka/list/` + encodeURIComponent(window.location.href),
|
||||
`${PUSHER_URL}/woka/list?roomUrl=` + encodeURIComponent(window.location.href),
|
||||
undefined,
|
||||
{
|
||||
responseType: "text",
|
||||
|
||||
@@ -50,7 +50,7 @@ export class SelectCharacterScene extends AbstractCharacterScene {
|
||||
// FIXME: window.location.href is wrong. We need the URL of the main room (so we need to apply any redirect before!)
|
||||
this.load.json(
|
||||
wokaMetadataKey,
|
||||
`${PUSHER_URL}/woka/list/` + encodeURIComponent(window.location.href),
|
||||
`${PUSHER_URL}/woka/list?roomUrl=` + encodeURIComponent(window.location.href),
|
||||
undefined,
|
||||
{
|
||||
responseType: "text",
|
||||
|
||||
Reference in New Issue
Block a user