Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wmioduszewski committed May 24, 2017
1 parent 7f93143 commit 3a36a90
Show file tree
Hide file tree
Showing 42 changed files with 414 additions and 440 deletions.
23 changes: 11 additions & 12 deletions source/CodeMate.WebApp/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
using System.Web;
using System.Web.Optimization;

namespace CodeMate.WebApp
namespace CodeMate.WebApp
{
using System.Web.Optimization;

public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
"~/Scripts/jquery-{version}.js"));

bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
"~/Scripts/jquery.validate*"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
"~/Scripts/modernizr-*"));

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));

bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
}
9 changes: 4 additions & 5 deletions source/CodeMate.WebApp/App_Start/FilterConfig.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System.Web;
using System.Web.Mvc;

namespace CodeMate.WebApp
namespace CodeMate.WebApp
{
using System.Web.Mvc;

public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
}
38 changes: 18 additions & 20 deletions source/CodeMate.WebApp/App_Start/IdentityConfig.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Web;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using CodeMate.WebApp.Models;

namespace CodeMate.WebApp
namespace CodeMate.WebApp
{
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Models;

public class EmailService : IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
Expand All @@ -40,7 +36,8 @@ public ApplicationUserManager(IUserStore<ApplicationUser> store)
{
}

public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options,
IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
// Configure validation logic for usernames
Expand Down Expand Up @@ -81,7 +78,7 @@ public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUs
var dataProtectionProvider = options.DataProtectionProvider;
if (dataProtectionProvider != null)
{
manager.UserTokenProvider =
manager.UserTokenProvider =
new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
}
return manager;
Expand All @@ -98,12 +95,13 @@ public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticat

public override Task<ClaimsIdentity> CreateUserIdentityAsync(ApplicationUser user)
{
return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager);
return user.GenerateUserIdentityAsync((ApplicationUserManager) UserManager);
}

public static ApplicationSignInManager Create(IdentityFactoryOptions<ApplicationSignInManager> options, IOwinContext context)
public static ApplicationSignInManager Create(IdentityFactoryOptions<ApplicationSignInManager> options,
IOwinContext context)
{
return new ApplicationSignInManager(context.GetUserManager<ApplicationUserManager>(), context.Authentication);
}
}
}
}
16 changes: 6 additions & 10 deletions source/CodeMate.WebApp/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace CodeMate.WebApp
namespace CodeMate.WebApp
{
using System.Web.Mvc;
using System.Web.Routing;

public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
Expand All @@ -16,8 +12,8 @@ public static void RegisterRoutes(RouteCollection routes)
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
defaults: new {controller = "Home", action = "Index", id = UrlParameter.Optional}
);
}
}
}
}
3 changes: 1 addition & 2 deletions source/CodeMate.WebApp/App_Start/Startup.Auth.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace CodeMate.WebApp
{
using System;
using System.Collections.Generic;
using System.Configuration;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
Expand Down Expand Up @@ -61,7 +60,7 @@ public void ConfigureAuth(IAppBuilder app)
githubOptions.Scope.Clear();
githubOptions.Scope.Add("user:email");

app.UseGitHubAuthentication("a","a");
app.UseGitHubAuthentication(githubOptions);
}

public string GetSetting(string settingId)
Expand Down
Loading

0 comments on commit 3a36a90

Please sign in to comment.