mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Stopped #3961 from happening
This commit is contained in:
parent
bb29b547b3
commit
c26f3337ed
2 changed files with 10 additions and 0 deletions
|
@ -88,6 +88,12 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
_log.LogInformation("Could not create Plex user since the have no username, PlexUserId: {0}", plexUser.Id);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((plexUser.Email.HasValue()) && await _userManager.FindByEmailAsync(plexUser.Email) != null)
|
||||
{
|
||||
_log.LogWarning($"Cannot add user {plexUser.Username} because their email address is already in Ombi, skipping this user");
|
||||
continue;
|
||||
}
|
||||
// Create this users
|
||||
// We do not store a password against the user since they will authenticate via Plex
|
||||
var newUser = new OmbiUser
|
||||
|
|
|
@ -457,6 +457,10 @@ namespace Ombi.Controllers.V1
|
|||
{
|
||||
return Error("You do not have the correct permissions to create this user");
|
||||
}
|
||||
if(user.EmailAddress.HasValue() && await UserManager.FindByEmailAsync(user.EmailAddress) != null)
|
||||
{
|
||||
return Error("This email has already been taken");
|
||||
}
|
||||
var ombiUser = new OmbiUser
|
||||
{
|
||||
Alias = user.Alias,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue