Skip to content

Instantly share code, notes, and snippets.

View chintanparikh's full-sized avatar
🎯
Focusing

Chintan Parikh chintanparikh

🎯
Focusing
View GitHub Profile
window.onload = function() {
$("#login").click(function(event) {
chrome.identity.launchWebAuthFlow(
{'url': 'http://localhost:3000/oauth/authorize?client_id=7b529aed5e89c14bd45c4cb949f220e5bc4cc440003dd7604d3fc6ed43f29844&redirect_uri=https%3A%2F%2Fhnjjholodahaklljjenjpfbkkghppdpk.chromiumapp.org%2Fvyrtex-chrome-extension&response_type=code', 'interactive': true},
function(redirect_url) {
console.log(redirect_url);
var code = redirect_url.substring(redirect_url.indexOf("=") + 1, redirect_url.length );
exchangeCodeForToken(code);
});
});