This commit is contained in:
2016-08-08 14:47:35 -04:00
commit 0b0cb7c73a
156 changed files with 114318 additions and 0 deletions
@@ -0,0 +1,18 @@
using InventoryTraker.Web.Core;
using Microsoft.AspNet.Identity;
namespace InventoryTraker.Web.Identity
{
public class ApplicationUserManager : UserManager<User>
{
public ApplicationUserManager(IUserStore<User> store)
: base(store)
{
UserValidator = new UserValidator<User>(this)
{
AllowOnlyAlphanumericUserNames = false,
RequireUniqueEmail = true
};
}
}
}
@@ -0,0 +1,21 @@
using System.Data.Entity;
using System.Web;
using InventoryTraker.Web.Core;
using InventoryTraker.Web.Data;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Owin.Security;
using StructureMap;
namespace InventoryTraker.Web.Identity
{
public class AspNetIdentityRegistry : Registry
{
public AspNetIdentityRegistry()
{
For<IUserStore<User>>().Use<UserStore<User>>();
For<DbContext>().Use<AppDbContext>();
For<IAuthenticationManager>().Use(ctx => ctx.GetInstance<HttpRequestBase>().GetOwinContext().Authentication);
}
}
}