Work around ambiguous calls
This commit is contained in:
@@ -487,7 +487,7 @@ public class AuthenticationApiController : ControllerBase
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
// Perform sign-in
|
||||
var userPrincipal = new ClaimsPrincipal(new ClaimsIdentity([new("id", user.Id.ToString())]));
|
||||
var userPrincipal = new ClaimsPrincipal(new ClaimsIdentity(claims: [new("id", user.Id.ToString())]));
|
||||
await HttpContext.SignInAsync(userPrincipal);
|
||||
var token = userPrincipal.FindFirstValue("token")
|
||||
?? throw new InvalidOperationException("Sign in handler did not add token");
|
||||
@@ -540,7 +540,7 @@ public class AuthenticationApiController : ControllerBase
|
||||
// Verify the account
|
||||
user.EmailVerified = true;
|
||||
// Create a session
|
||||
var userPrincipal = new ClaimsPrincipal(new ClaimsIdentity([new("id", user.Id.ToString())]));
|
||||
var userPrincipal = new ClaimsPrincipal(new ClaimsIdentity(claims: [new("id", user.Id.ToString())]));
|
||||
await HttpContext.SignInAsync(userPrincipal);
|
||||
var token = userPrincipal.FindFirstValue("token")
|
||||
?? throw new InvalidOperationException("Sign in handler did not add token");
|
||||
@@ -720,7 +720,7 @@ public class AuthenticationApiController : ControllerBase
|
||||
{
|
||||
user.EmailVerified = true;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
var userPrincipal = new ClaimsPrincipal(new ClaimsIdentity([new("id", user.Id.ToString())]));
|
||||
var userPrincipal = new ClaimsPrincipal(new ClaimsIdentity(claims: [new("id", user.Id.ToString())]));
|
||||
await HttpContext.SignInAsync(userPrincipal);
|
||||
token = userPrincipal.FindFirstValue("token")
|
||||
?? throw new InvalidOperationException("Sign in handler did not add token");
|
||||
|
||||
Reference in New Issue
Block a user