Category : nestjs

I’m implementing Google login with Nestjs, Passport and oauth2. Also I’m trying to connect my Nestjs REST API app with an Angular 10 frontend. In my auth.controller.js I have: @UseGuards(AuthGuard(‘google’)) async googleAuth(@Req() req) {} @Get(‘google/redirect’) @UseGuards(AuthGuard(‘google’)) async googleLoginRedirect(@Req() req: Request, @Res() res: Response): Promise<any> { // show current user console.log(req.user); return { statusCode: HttpStatus.OK, payload: ..

Read more

First of all, angular has the lazy-loaded modules which make sense in frontend projects (since each module gets loaded whenever needed in the user’s browser). So, for example, if I have a TableModule, I can only import it in my lazy-loaded module. Then it won’t be included on the home page. This means we don’t ..

Read more

As I mentioned in the question cookies are present in the response header but it’s not shown in the browser Application -> cookies Here I added withCredential but it’s not working. my angular code getSecretCode(passCode: number) { const httpOptions = { headers: new HttpHeaders({ ‘Accept’: ‘text/html’, ‘Content-Type’: ‘text/plain; charset=utf-8’ }), xhrFields: { withCredentials: true, }, ..

Read more

I have the next packages installed: Angular v. 10 ngx-socket-io v.3.2.0 @nestjs/platform-socket.io @nestjs/[email protected], [email protected] The issue is: I have a chat component and a thread component. When I’m answering in thread there should fire socket.on(‘createThreadMessage:response’) event at the chat component. I works on my currently open browser, but I can’t receive the same event on ..

Read more