Skip to content

Commit

Permalink
fix(plex-oauth): 🐛 Fixed an issue where using OAuth you could log in …
Browse files Browse the repository at this point in the history
…as a Ombi Local user #4835
  • Loading branch information
tidusjar committed Feb 16, 2023
1 parent 86d9837 commit 4098da3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ombi/Controllers/V1/TokenController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ public async Task<IActionResult> OAuth(int pinId)
// Could this be an email login?
user = await _userManager.FindByEmailAsync(account.user.email);

if (user == null)
if (user == null || user.UserType != UserType.PlexUser)
{
return new UnauthorizedResult();
}
}

user.MediaServerToken = account.user.authentication_token;
await _userManager.UpdateAsync(user);
await _userManager.UpdateAsync(user);

return await CreateToken(true, user);
}
Expand Down

0 comments on commit 4098da3

Please sign in to comment.