Intial
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user