Last active
December 20, 2018 09:57
-
-
Save LsTinyBaby/4bc9a7a0a4c9de360b7f7c222b3b43a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var access_token; | |
var data = new FormData; | |
data.append('fb_dtsg', require('DTSGInitialData').token); | |
data.append('app_id', '165907476854626'); | |
data.append('redirect_uri', 'fbconnect://success'); | |
data.append('display', 'popup'); | |
data.append('from_post', '1'); | |
data.append('ref', 'Default'); | |
data.append('return_format', 'access_token'); | |
fetch('/v1.0/dialog/oauth/confirm', { | |
authority: 'www.facebook.com', | |
body: data, | |
method: 'POST' | |
}).then(function(res) { | |
res.text().then(function(text) { | |
access_token = text.match(/access_token=(.*?)&/)[1]; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment