mirror of
https://github.com/byo-software/steam-openid-connect-provider.git
synced 2025-01-09 18:06:22 +00:00
Fix not being able to login when some steam info is missing
This commit is contained in:
parent
6c4eb1db4d
commit
7d2667ebb2
1 changed files with 12 additions and 4 deletions
|
@ -61,15 +61,23 @@ namespace SteamOpenIdConnectProvider.Profile
|
|||
|
||||
if (player != null)
|
||||
{
|
||||
claims.Add(new Claim("picture", player.AvatarFull));
|
||||
claims.Add(new Claim("nickname", player.PersonaName));
|
||||
claims.Add(new Claim("given_name", player.RealName));
|
||||
claims.Add(new Claim("website", player.ProfileUrl));
|
||||
AddClaim(claims, "picture", player.AvatarFull);
|
||||
AddClaim(claims, "nickname", player.PersonaName);
|
||||
AddClaim(claims, "given_name", player.RealName);
|
||||
AddClaim(claims, "website", player.ProfileUrl);
|
||||
}
|
||||
|
||||
context.IssuedClaims = claims;
|
||||
}
|
||||
|
||||
private void AddClaim(List<Claim> claims, string type, string value)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
claims.Add(new Claim(type, value));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task IsActiveAsync(IsActiveContext context)
|
||||
{
|
||||
var sub = context.Subject.GetSubjectId();
|
||||
|
|
Loading…
Reference in a new issue