mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -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);
|
_log.LogInformation("Could not create Plex user since the have no username, PlexUserId: {0}", plexUser.Id);
|
||||||
continue;
|
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
|
// Create this users
|
||||||
// We do not store a password against the user since they will authenticate via Plex
|
// We do not store a password against the user since they will authenticate via Plex
|
||||||
var newUser = new OmbiUser
|
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");
|
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
|
var ombiUser = new OmbiUser
|
||||||
{
|
{
|
||||||
Alias = user.Alias,
|
Alias = user.Alias,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue