mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
fix(plex-oauth): 🐛 Fixed an issue where using OAuth you could log in as a Ombi Local user #4835
This commit is contained in:
parent
86d9837ba2
commit
4098da305a
1 changed files with 2 additions and 2 deletions
|
@ -209,14 +209,14 @@ namespace Ombi.Controllers.V1
|
||||||
// Could this be an email login?
|
// Could this be an email login?
|
||||||
user = await _userManager.FindByEmailAsync(account.user.email);
|
user = await _userManager.FindByEmailAsync(account.user.email);
|
||||||
|
|
||||||
if (user == null)
|
if (user == null || user.UserType != UserType.PlexUser)
|
||||||
{
|
{
|
||||||
return new UnauthorizedResult();
|
return new UnauthorizedResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
user.MediaServerToken = account.user.authentication_token;
|
user.MediaServerToken = account.user.authentication_token;
|
||||||
await _userManager.UpdateAsync(user);
|
await _userManager.UpdateAsync(user);
|
||||||
|
|
||||||
return await CreateToken(true, user);
|
return await CreateToken(true, user);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue