Changed the logic to check if logout done by mobile APP

This commit is contained in:
ashutosh.nehete 2025-08-19 15:39:34 +05:30
parent 5538c3ae25
commit f6ce8dd4f6

View File

@ -390,8 +390,8 @@ namespace MarcoBMS.Services.Controllers
await _refreshTokenService.BlacklistJwtTokenAsync(jwtToken);
_logger.LogInfo("JWT access token blacklisted successfully");
}
string? origin = HttpContext.Request.Headers["Origin"].FirstOrDefault();
if (string.IsNullOrWhiteSpace(origin))
string userAgent = HttpContext.Request.Headers["User-Agent"].ToString();
if (userAgent.Contains("Dart"))
{
var fcmTokenMapping = await _context.FCMTokenMappings.FirstOrDefaultAsync(ft => ft.EmployeeId == loggedInEmployee.Id && ft.TenantId == tenentId);
if (fcmTokenMapping != null)