import { Body, Controller, Post, Req, UseGuards } from '@nestjs/common'; import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard'; import { AuthService } from '../services/auth.service'; import { UAParser } from 'ua-parser-js'; @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} // @Post('fcmtoken') // @UseGuards(JwtAuthGuard) // async getDashboard(@Req() req: any, @Body('fcmtoken') fcmtoken: string) { // const loggedInUser = req.user.userData; // const ip = // (req.headers['x-forwarded-for'] as string)?.split(',')[0].trim() || // req.socket.remoteAddress || // req.ip || // ''; // const userAgent = req.headers['user-agent'] || ''; // const parser = new UAParser(userAgent); // const browser = parser.getBrowser().name || 'Unknown'; // const os = parser.getOS().name || 'Unknown'; // return this.authService.fcmtoken(fcmtoken, loggedInUser, ip, browser, os); // } }