packages/pico-engine/src/oauth_server.js
function (auth) {
      var clientCredentials = Buffer.from(auth.slice('basic '.length), 'base64').toString().split(':')
      var clientId = querystring.unescape(clientCredentials[0])
      var clientSecret = querystring.unescape(clientCredentials[1])
      return { id: clientId, secret: clientSecret }
    }
function (auth) {
      var clientCredentials = Buffer.from(auth.slice('basic '.length), 'base64').toString().split(':')
      var clientId = querystring.unescape(clientCredentials[0])
      var clientSecret = querystring.unescape(clientCredentials[1])
      return { id: clientId, secret: clientSecret }
    }
function ( auth ) { var clientCredentials = Buffer . from ( auth . slice ( 'basic ' . length ) , 'base64' ) . toString ( ) . split ( ':' ) var clientId = querystring . unescape ( clientCredentials [ 0 ] ) var clientSecret = querystring . unescape ( clientCredentials [ 1 ] ) return { id : clientId , secret : clientSecret } }
start of code borrowed from OAuth in Action
start of code borrowed from OAuth in Action