diff --git a/controllers/gameController.js b/controllers/gameController.js index c823830..b646a22 100644 --- a/controllers/gameController.js +++ b/controllers/gameController.js @@ -35,13 +35,13 @@ module.exports = { return res.status(409).json({ message: 'Game already exists' }); } - const uri = "https://id.twitch.tv/oauth2/token?client_id=" + userFound.client_id + "&client_secret=" + userFound.client_secret + "&grant_type=client_credentials"; + const uri = "https://id.twitch.tv/oauth2/token?client_id=" + userFound.twitch_client_id + "&client_secret=" + userFound.twitch_client_secret + "&grant_type=client_credentials"; var response = await fetch(uri, { method: 'POST' }); var mData = await response.json(); var mheaders = { 'Accept': 'application/json', - 'Client-ID': userFound.client_id, + 'Client-ID': userFound.twitch_client_id, 'Authorization': 'Bearer ' + mData.access_token } diff --git a/controllers/mediaController.js b/controllers/mediaController.js index a188e3f..c3c7c5b 100644 --- a/controllers/mediaController.js +++ b/controllers/mediaController.js @@ -45,7 +45,7 @@ module.exports = { return res.status(409).json({ message: 'Media already exists' }); } - const uri = `http://www.omdbapi.com/?i=${mediaCode}&apikey=${userFound.key}`; + const uri = `http://www.omdbapi.com/?i=${mediaCode}&apikey=${userFound.omdb_key}`; const mJson = await fetch(uri); const mData = await mJson.json(); diff --git a/models/userModel.js b/models/userModel.js index f693e35..864a2ba 100644 --- a/models/userModel.js +++ b/models/userModel.js @@ -3,9 +3,9 @@ var Schema = mongoose.Schema; var userSchema = new Schema({ 'pass': String, - 'key': String, - 'client_id': String, - 'client_secret': String, + 'omdb_key': String, + 'twitch_client_id': String, + 'twitch_client_secret': String, }); module.exports = mongoose.model('user', userSchema); \ No newline at end of file diff --git a/routes/list.js b/routes/list.js index f822610..a6a0a94 100644 --- a/routes/list.js +++ b/routes/list.js @@ -1,5 +1,4 @@ var express = require('express'); -const fs = require('fs'); var router = express.Router(); /* GET home page. */