[UPD] add google path
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
import { User } from '../models/user';
|
||||
import { JwtToken } from './models/jwt';
|
||||
import { LoginDto } from './dto/login.dto';
|
||||
import { GoogleAuthGuard } from './google-auth.guard';
|
||||
|
||||
@ApiTags('auth')
|
||||
@Controller('auth')
|
||||
@@ -68,4 +69,14 @@ export class AuthController {
|
||||
deleteSelf(@Request() req: any): Promise<User> {
|
||||
return this.usersService.deleteUser({ id: req.user.id });
|
||||
}
|
||||
|
||||
@UseGuards(GoogleAuthGuard)
|
||||
@Get('google')
|
||||
async googleAuth(@Request() req: any) {}
|
||||
|
||||
@UseGuards(GoogleAuthGuard)
|
||||
@Get('google/callback')
|
||||
async googleAuthRedirect(@Request() req: any) {
|
||||
return this.authService.login(req.user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user