From 4098da305aaea9dae9a552644268a4fed7204cfe Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 16 Feb 2023 21:01:18 +0000 Subject: [PATCH] =?UTF-8?q?fix(plex-oauth):=20=F0=9F=90=9B=20Fixed=20an=20?= =?UTF-8?q?issue=20where=20using=20OAuth=20you=20could=20log=20in=20as=20a?= =?UTF-8?q?=20Ombi=20Local=20user=20#4835?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Ombi/Controllers/V1/TokenController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/Controllers/V1/TokenController.cs b/src/Ombi/Controllers/V1/TokenController.cs index 7744a3928..872551a27 100644 --- a/src/Ombi/Controllers/V1/TokenController.cs +++ b/src/Ombi/Controllers/V1/TokenController.cs @@ -209,14 +209,14 @@ namespace Ombi.Controllers.V1 // 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); }