diff --git a/ListMonk.SDK b/ListMonk.SDK new file mode 160000 index 0000000..4cb43f9 --- /dev/null +++ b/ListMonk.SDK @@ -0,0 +1 @@ +Subproject commit 4cb43f91bdc6a5dc0db292dfbccf7ad8b43f468c diff --git a/Streetwriters.Identity/Controllers/SignupController.cs b/Streetwriters.Identity/Controllers/SignupController.cs index 85f0aeb..18a606b 100644 --- a/Streetwriters.Identity/Controllers/SignupController.cs +++ b/Streetwriters.Identity/Controllers/SignupController.cs @@ -103,6 +103,7 @@ namespace Streetwriters.Identity.Controllers await UserManager.AddToRoleAsync(user, client.Id); if (Constants.IS_SELF_HOSTED) await UserManager.AddClaimAsync(user, UserService.SubscriptionTypeToClaim(client.Id, Common.Enums.SubscriptionType.PREMIUM)); + await UserManager.AddClaimAsync(user, new Claim("platform", PlatformFromUserAgent(base.HttpContext.Request.Headers.UserAgent))); var code = await UserManager.GenerateEmailConfirmationTokenAsync(user); var callbackUrl = Url.TokenLink(user.Id.ToString(), code, client.Id, TokenType.CONFRIM_EMAIL, Request.Scheme); @@ -116,5 +117,10 @@ namespace Streetwriters.Identity.Controllers return BadRequest(result.Errors.ToErrors()); } + + string PlatformFromUserAgent(string userAgent) + { + return userAgent.Contains("okhttp/") ? "android" : userAgent.Contains("Darwin/") || userAgent.Contains("CFNetwork/") ? "ios" : "web"; + } } }