|
@ -9,7 +9,9 @@ import { |
|
|
Post, |
|
|
Post, |
|
|
Req, |
|
|
Req, |
|
|
Res, |
|
|
Res, |
|
|
UseGuards |
|
|
UseGuards, |
|
|
|
|
|
Version, |
|
|
|
|
|
VERSION_NEUTRAL |
|
|
} from '@nestjs/common'; |
|
|
} from '@nestjs/common'; |
|
|
import { AuthGuard } from '@nestjs/passport'; |
|
|
import { AuthGuard } from '@nestjs/passport'; |
|
|
import { StatusCodes, getReasonPhrase } from 'http-status-codes'; |
|
|
import { StatusCodes, getReasonPhrase } from 'http-status-codes'; |
|
@ -51,6 +53,7 @@ export class AuthController { |
|
|
|
|
|
|
|
|
@Get('google/callback') |
|
|
@Get('google/callback') |
|
|
@UseGuards(AuthGuard('google')) |
|
|
@UseGuards(AuthGuard('google')) |
|
|
|
|
|
@Version(VERSION_NEUTRAL) |
|
|
public googleLoginCallback(@Req() req, @Res() res) { |
|
|
public googleLoginCallback(@Req() req, @Res() res) { |
|
|
// Handles the Google OAuth2 callback
|
|
|
// Handles the Google OAuth2 callback
|
|
|
const jwt: string = req.user.jwt; |
|
|
const jwt: string = req.user.jwt; |
|
|