Removed outdated user repo stuff

This commit is contained in:
Fergal Moran
2018-04-25 18:50:29 +01:00
parent 231b3ccd7e
commit 9bc49a37f8
34 changed files with 599 additions and 463 deletions

View File

@@ -0,0 +1,20 @@
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using PodNoms.Api.Services.Auth;
public class BaseAuthController : Controller {
private readonly ClaimsPrincipal _caller;
protected readonly UserManager<ApplicationUser> _userManager;
protected readonly string _userId;
protected readonly ApplicationUser _applicationUser;
public BaseAuthController(IHttpContextAccessor contextAccessor, UserManager<ApplicationUser> userManager) {
_caller = contextAccessor.HttpContext.User;
_userManager = userManager;
_userId = _caller.Claims.Single(c => c.Type == "id").Value;
_applicationUser = userManager.FindByIdAsync(_userId).Result;
}
}