MCPcopy Create free account
hub / github.com/GmpABR/NexusFlow / GetUserId

Method GetUserId

backend/Controllers/AnalyticsController.cs:256–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254 });
255 }
256
257 private int GetUserId()
258 {
259 var idClaim = User.FindFirst(ClaimTypes.NameIdentifier)?.Value
260 ?? User.FindFirst("sub")?.Value
261 ?? User.FindFirst("id")?.Value;
262
263 if (int.TryParse(idClaim, out int userId)) return userId;
264 return 0;
265 }
266}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected