update user model
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user