Skip to content
Snippets Groups Projects
Commit b4c5d5de authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Merge branch 'master' into 'dev'

Master

See merge request !149
parents 9f8009f8 9db15627
No related branches found
No related tags found
2 merge requests!155Dev,!149Master
......@@ -86,14 +86,14 @@ namespace Coscine.Api.STS.Controllers
}
}
if (validMerge && contents != null && contents.Any((claim) => claim.Type == "UserGuid"))
if (validMerge && contents?.Any((claim) => claim.Type == "UserGuid") == true)
{
var userGuidString = contents.Where((claim) => claim.Type == "UserGuid").First();
var userGuidString = contents.First((claim) => claim.Type == "UserGuid");
var correctGuid = Guid.TryParse(userGuidString.Value, out Guid userGuid);
if (correctGuid)
{
var userList = userModel.GetAllWhere((user) => user.Id == userGuid);
if (userList.Count() > 0)
if (userList.Any())
{
var mergeIntoUser = userList.First();
......@@ -116,7 +116,18 @@ namespace Coscine.Api.STS.Controllers
}
}
}
}
else if (contents?.Any((claim) => claim.Type == "UserGuid") == true)
{
var userGuidString = contents.First((claim) => claim.Type == "UserGuid");
var coscineUser = new CoscineUser()
{
UserName = userGuidString.Value,
Email = ""
};
await _signInManager.SignInAsync(coscineUser, isPersistent: false);
return Redirect(UrlGenerator.ExtendReturnUrl(returnUrl, Request));
}
string loginUrl = UrlGenerator.GetLoginUrl(Request);
......
......@@ -6,7 +6,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net6.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>4.0.9</Version>
<Version>4.1.0</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment