Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Swapped Buffer.alloc to Buffer.from.
  • Loading branch information
James Haggard committed Aug 22, 2017
1 parent f1b5161 commit f2a3de1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/Client.js
Expand Up @@ -942,7 +942,7 @@ var authenticators = {
'client_secret_basic': function (req, callback) {
var authorization = req.headers.authorization.split(' ')
var scheme = authorization[0]
var credentials = Buffer.alloc(authorization[1].length, authorization[1], 'base64')
var credentials = Buffer.from(authorization[1], 'base64')
.toString('ascii')
.split(':')
var clientId = credentials[0]
Expand Down
2 changes: 1 addition & 1 deletion protocols/OAuth2.js
Expand Up @@ -112,7 +112,7 @@ function base64credentials () {
var secret = this.client.client_secret
var credentials = id + ':' + secret

return Buffer.alloc(credentials.length, credentials).toString('base64')
return Buffer.from(credentials).toString('base64')
}

OAuth2Strategy.prototype.base64credentials = base64credentials
Expand Down

0 comments on commit f2a3de1

Please sign in to comment.