Skip to content

Commit

Permalink
Merge pull request #299 from Quickchive/fix/#294-add-domain-to-cookie
Browse files Browse the repository at this point in the history
Fix/#294 add domain to cookie
  • Loading branch information
stae1102 authored Mar 3, 2024
2 parents a9a9e1a + 5ab9f5e commit ea23940
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/auth/oauth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,7 @@ export class OAuthController {
@UseGuards(AuthGuard('google'))
async googleAuthRedirect(
@AuthUser() user: googleUserInfo,
@Res() response: Response,
) {
const { access_token, refresh_token } = await this.oauthService.googleOauth(
user,
);

const cookieOption = this.oauthService.getCookieOption();

response.cookie('accessToken', access_token, cookieOption);
response.cookie('refreshToken', refresh_token, cookieOption);

response.redirect(process.env.FRONTEND_REDIRECT_URL!);
): Promise<LoginOutput> {
return this.oauthService.googleOauth(user);
}
}

0 comments on commit ea23940

Please sign in to comment.