Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function handleAuthClick() {
- tokenClient.callback = async (resp) => {
- if (resp.error !== undefined) {
- throw (resp);
- }
- await listUpcomingEvents();
- };
- if (document.cookie === null) {
- tokenClient.requestAccessToken({prompt: 'consent'});
- } else {
- tokenClient.requestAccessToken({prompt: ''});
- }
- setTimeout(() => document.cookie = `token=${gapi.client.getToken()}; expires=Tue, 19 Jan 2038 04:14:07 GMT`, 20000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement