Answers for "hot get access_token instead of url"

0

hot get access_token instead of url

var urlString = 'http://localhost:3000/_oauth/google#access_token=ya29.5HxuYol1Io8JLeGePDznbfkkwu_PC4uodKwG8_1clFYAn9AgdOV1WGpOTNQP3s76HAsn7Y4zWw&token_type=Bearer&expires_in=3600';

var url = new URL(urlString);
// OR: If you want to use the current page's URL
var url = window.location;

var access_token = new URLSearchParams(url.search).get('access_token');
Posted by: Guest on May-14-2020

Code answers related to "hot get access_token instead of url"

Code answers related to "Javascript"

Browse Popular Code Answers by Language