Skip to content

Commit

Permalink
Remove unneeded method parameters
Browse files Browse the repository at this point in the history
These services are already injected in the constructor
  • Loading branch information
rmunn committed Sep 27, 2024
1 parent f431e9f commit 8b939a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/LexBoxApi/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ await HttpContext.SignInAsync(user.GetPrincipal("Registration"),
[RequireAudience(LexboxAudience.RegisterAccount, true)]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
public async Task<ActionResult> HandleInviteLink(LoggedInContext loggedInContext, LexBoxDbContext dbContext)
public async Task<ActionResult> HandleInviteLink()
{
var user = loggedInContext.User;
var user = _loggedInContext.User;
if (user.Email is null)
{
// Malformed JWT, exit early
return Redirect("/login");
}
var dbUser = await dbContext.Users
var dbUser = await _lexBoxDbContext.Users
.Where(u => u.Email == user.Email)
.Include(u => u.Projects)
.Include(u => u.Organizations)
Expand All @@ -110,7 +110,7 @@ public async Task<ActionResult> HandleInviteLink(LoggedInContext loggedInContext
{
// No need to re-register users that already exist
UpdateUserMemberships(user, dbUser);
await dbContext.SaveChangesAsync();
await _lexBoxDbContext.SaveChangesAsync();
var loginUser = new LexAuthUser(dbUser);
await HttpContext.SignInAsync(loginUser.GetPrincipal("Invitation"),
new AuthenticationProperties { IsPersistent = true });
Expand Down

0 comments on commit 8b939a1

Please sign in to comment.