Skip to content

Commit

Permalink
working on callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Apr 20, 2024
1 parent 15a158a commit d2e0bc2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/controllers/platform.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ const connectPlatform = catchAsync(async function (req: ISessionRequest, res: Re
res.redirect(twitterUrl);
}
else if (platform === 'google') {
console.log('wtcvvdf')
const scopes = googleService.coreService.GoogleClientManager.scopes;
console.log(scopes)
const scopes = google.scopes.googleDrive;
const authUrl = await googleService.coreService.GoogleClientManager.generateAuthUrl('offline', scopes);
res.redirect(authUrl);
}
Expand Down Expand Up @@ -117,10 +115,8 @@ const connectGoogleCallback = catchAsync(async function (req: ISessionRequest, r
const STATUS_CODE_SUCCESS = 1008;
const STATUS_CODE_ERROR = 1009;
const code = req.query.code as string;
const returnedState = req.query.state as string;
const storedState = req.session.state;
try {
console.log(code, 999)
console.log(await googleService.coreService.GoogleClientManager.getTokens(code), 555)
// if (!code || !returnedState || returnedState !== storedState) {
// throw new Error('Invalid code or state mismatch');
// }
Expand Down

0 comments on commit d2e0bc2

Please sign in to comment.