Advertisement
Guest User

Untitled

a guest
May 27th, 2022
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function handleAuthClick() {
  2. tokenClient.callback = async (resp) => {
  3. if (resp.error !== undefined) {
  4. throw (resp);
  5. }
  6. await listUpcomingEvents();
  7. };
  8.  
  9. if (document.cookie === null) {
  10. tokenClient.requestAccessToken({prompt: 'consent'});
  11. } else {
  12. tokenClient.requestAccessToken({prompt: ''});
  13. }
  14. setTimeout(() => document.cookie = `token=${gapi.client.getToken()}; expires=Tue, 19 Jan 2038 04:14:07 GMT`, 20000);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement