Skip to content

Commit

Permalink
Merge pull request #36 from BellumGens/user-details-sc2
Browse files Browse the repository at this point in the history
feat: updating player profile
  • Loading branch information
kdinev authored Dec 12, 2024
2 parents 70027ee + 15aeebe commit c2750c4
Show file tree
Hide file tree
Showing 11 changed files with 2,053 additions and 325 deletions.
6 changes: 5 additions & 1 deletion BellumGens.Api.Core/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,17 @@ private async Task<IdentityResult> Register(ExternalLoginInfo info)
};
break;
case "Steam":
var steamId = _steamService.SteamUserId(providerId);
user = new ApplicationUser()
{
Id = Guid.NewGuid().ToString(),
UserName = username,
Email = email,
EmailConfirmed = true,
SteamID = steamId,
CSGODetails = new CSGODetails()
{
SteamId = _steamService.SteamUserId(providerId)
SteamId = steamId
}
};
break;
Expand Down Expand Up @@ -531,6 +533,7 @@ private async Task<IdentityResult> AddLogin(string userId, ExternalLoginInfo inf
string steamid = _steamService.SteamUserId(providerId);
if (user.SteamID != steamid)
{
user.SteamID = steamid;
user.CSGODetails.SteamId = steamid;
await _dbContext.SaveChangesAsync();
}
Expand All @@ -539,6 +542,7 @@ private async Task<IdentityResult> AddLogin(string userId, ExternalLoginInfo inf
var battletag = info.Principal.FindFirstValue(ClaimTypes.Name);
if (user.BattleNetId != providerId)
{
user.BattleNetId = providerId;
user.StarCraft2Details = new StarCraft2Details()
{
BattleNetBattleTag = battletag,
Expand Down
Loading

0 comments on commit c2750c4

Please sign in to comment.