mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added logging around creating the wizard user #1604
This commit is contained in:
parent
a74617b70c
commit
d66e09b98f
1 changed files with 12 additions and 2 deletions
|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization;
|
|||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
using Ombi.Attributes;
|
||||
|
@ -45,7 +46,8 @@ namespace Ombi.Controllers
|
|||
ISettingsService<CustomizationSettings> c,
|
||||
IWelcomeEmail welcome,
|
||||
IMovieRequestRepository m,
|
||||
ITvRequestRepository t)
|
||||
ITvRequestRepository t,
|
||||
ILogger<IdentityController> l)
|
||||
{
|
||||
UserManager = user;
|
||||
Mapper = mapper;
|
||||
|
@ -56,6 +58,7 @@ namespace Ombi.Controllers
|
|||
WelcomeEmail = welcome;
|
||||
MovieRepo = m;
|
||||
TvRepo = t;
|
||||
_log = l;
|
||||
}
|
||||
|
||||
private OmbiUserManager UserManager { get; }
|
||||
|
@ -67,6 +70,7 @@ namespace Ombi.Controllers
|
|||
private IWelcomeEmail WelcomeEmail { get; }
|
||||
private IMovieRequestRepository MovieRepo { get; }
|
||||
private ITvRequestRepository TvRepo { get; }
|
||||
private ILogger<IdentityController> _log;
|
||||
|
||||
/// <summary>
|
||||
/// This is what the Wizard will call when creating the user for the very first time.
|
||||
|
@ -101,7 +105,13 @@ namespace Ombi.Controllers
|
|||
await CreateRoles();
|
||||
await UserManager.AddToRoleAsync(userToCreate, OmbiRoles.Admin);
|
||||
}
|
||||
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
foreach (var err in result.Errors)
|
||||
{
|
||||
_log.LogCritical(err.Description);
|
||||
}
|
||||
}
|
||||
return result.Succeeded;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue