()
| 54 | } |
| 55 | |
| 56 | async function createAuthClient() { |
| 57 | const redirectUri = 'http://localhost:8085/'; |
| 58 | |
| 59 | const oauth2Client = new google.auth.OAuth2(oauthDetails.clientId, oauthDetails.clientSecret, redirectUri); |
| 60 | |
| 61 | const scopes = [ |
| 62 | 'openid', |
| 63 | 'https://www.googleapis.com/auth/cloud-platform', |
| 64 | 'https://www.googleapis.com/auth/userinfo.email', |
| 65 | ]; |
| 66 | |
| 67 | const authUrl = oauth2Client.generateAuthUrl({ |
| 68 | access_type: 'offline', |
| 69 | scope: scopes |
| 70 | }); |
| 71 | |
| 72 | return { authUrl, oauth2Client }; |
| 73 | } |