master
adb-sh 2 years ago
parent 03a5708d75
commit 371a10b126

@ -43,8 +43,11 @@ export const applyAuthRoutes = (router) => {
const user = store.users.find(({ client }) => client.user.id === newClient.user.id); const user = store.users.find(({ client }) => client.user.id === newClient.user.id);
if (user) { if (user) {
user.client = newClient; user.client = newClient;
user.player = player;
user.accessToken = accessToken;
} else {
store.users.push({ client: newClient, player, accessToken, listeners: [], role: 'none' });
} }
store.users.push({ client: newClient, player, accessToken, listeners: [], role: 'none' });
res.status(200); res.status(200);
res.send({ message: 'authorized', accessToken }); res.send({ message: 'authorized', accessToken });
} catch (e) { } catch (e) {

@ -1,6 +1,6 @@
export const store = { export const store = {
users: [], users: [],
clientID: '02d74b98c7904d6498b0b79def49cc5c', clientID: process.env.APP_SPOTIFY_CLIENT_ID,
clientSecret: 'e43b819037eb48e6b190865fc2c47b21', clientSecret: process.env.APP_SPOTIFY_CLIENT_SECRET,
redirectURL: 'http://127.0.0.1:8083/auth/callback', redirectURL: process.env.APP_SPOTIFY_REDIRECT_URI,
}; };

@ -1 +1 @@
Subproject commit 2d2383b8ae320ceaf123f35916716191b96368a2 Subproject commit 4b26d3aeef51185f4e27ae9e8700b378cd6cec0d
Loading…
Cancel
Save