mirror of
https://github.com/mjrode/WhatToWatch.git
synced 2025-12-30 18:19:46 -06:00
Filter servers based on access token
This commit is contained in:
@@ -25,7 +25,7 @@ passport.use(
|
||||
async (accessToken, refreshToken, profile, done) => {
|
||||
console.log(profile);
|
||||
const existingUser = await models.User.findOne({
|
||||
where: {googleId: profile.id},
|
||||
where: {googleId: '103913097386807680151'},
|
||||
});
|
||||
|
||||
if (existingUser) {
|
||||
|
||||
@@ -84,6 +84,9 @@ const getPlexUrl = async (plexToken, user) => {
|
||||
if (!Array.isArray(formattedResponse)) {
|
||||
formattedResponse = [formattedResponse];
|
||||
}
|
||||
formattedResponse.filter(server => {
|
||||
server.accessToken === plexToken;
|
||||
});
|
||||
console.log('formatted response', formattedResponse);
|
||||
const server = formattedResponse.slice(-1)[0];
|
||||
console.log('server', server);
|
||||
|
||||
Reference in New Issue
Block a user