mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-23 22:12:32 -05:00
12 lines
357 B
CoffeeScript
12 lines
357 B
CoffeeScript
|
request = require 'request'
|
||
|
Promise = require 'bluebird'
|
||
|
|
||
|
module.exports.fetchMe = (gplusAccessToken) ->
|
||
|
return new Promise (resolve, reject) ->
|
||
|
url = "https://www.googleapis.com/oauth2/v2/userinfo?access_token=#{gplusAccessToken}"
|
||
|
request.get url, {json: true}, (err, res) ->
|
||
|
if err
|
||
|
reject(err)
|
||
|
else
|
||
|
resolve(res.body)
|