Skip to content

Instantly share code, notes, and snippets.

@iMichaelOwolabi
Last active April 29, 2020 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iMichaelOwolabi/f4f5169f7144b9d50613b8ec00c618d0 to your computer and use it in GitHub Desktop.
Save iMichaelOwolabi/f4f5169f7144b9d50613b8ec00c618d0 to your computer and use it in GitHub Desktop.
import { Controller, Get, Req, UseGuards } from '@nestjs/common';
import { AppService } from './app.service';
import { AuthGuard } from '@nestjs/passport';
@Controller('google')
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
@UseGuards(AuthGuard('google'))
async googleAuth(@Req() req) {}
@Get('redirect')
@UseGuards(AuthGuard('google'))
googleAuthRedirect(@Req() req) {
return this.appService.googleLogin(req)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment