Remove UserValidators before creating account

We do not need to check if the username etc is valid.
Steam usernames can contain spaces, UTF8 characters, etc.
This commit is contained in:
Enes Sadık Özbek 2019-08-24 16:29:18 +03:00
parent a18758cf41
commit 9938d014a7

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
@ -66,6 +67,8 @@ namespace SteamOpenIdConnectProxy
var userId = info.Principal.FindFirstValue(ClaimTypes.NameIdentifier);
var user = new IdentityUser { UserName = userName, Id = userId };
_userManager.UserValidators.Clear();
var result = await _userManager.CreateAsync(user);
if (result.Succeeded)
{