Skip to content

Commit bebb421

Browse files
committed
moved from querystring to URLSearchParams
1 parent 377e0bc commit bebb421

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

controllers/spotifyController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const client_id = process.env.SCLIENT_ID;
66
const redirect_uri = process.env.S_REDIRECT;
77

88

9-
function generateRandomString(length){
9+
function generateRandomString(length) {
1010
return crypto.randomBytes(length).toString('hex');
1111
};
1212

13-
function hashCode(code){
13+
function hashCode(code) {
1414
return crypto.createHash('sha256').update(code).digest('base64');
1515
}
1616
exports.getAuthorization = function (req, res) {
@@ -20,7 +20,7 @@ exports.getAuthorization = function (req, res) {
2020
let scope = 'user-read-private playlist-read-private';
2121

2222
res.redirect('https://accounts.spotify.com/authorize?' +
23-
querystring.stringify({
23+
new URLSearchParams({
2424
response_type: 'code',
2525
client_id: client_id,
2626
scope: scope,

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"dotenv": "^10.0.0",
2222
"express": "^4.17.1",
2323
"mongoose": "^6.0.12",
24-
"nodemon": "^2.0.14",
25-
"querystring": "^0.2.1"
24+
"nodemon": "^2.0.14"
2625
}
2726
}

0 commit comments

Comments
 (0)