identity: handle crash on introspection when user is null

This commit is contained in:
Abdullah Atta
2024-06-07 15:36:01 +05:00
parent 99da765a1c
commit 64ae13b589
@@ -46,6 +46,7 @@ namespace Streetwriters.Identity.Services
if (result.TryGetValue("sub", out object userId))
{
var user = await UserManager.FindByIdAsync(userId.ToString());
if (user == null || user.Claims == null) return result;
var verifiedClaim = user.Claims.Find((c) => c.ClaimType == "verified");
if (verifiedClaim != null)