1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-22 16:57:36 +01:00

comments and some name changes

This commit is contained in:
Kyle Spearrin 2015-12-30 18:49:43 -05:00
parent c62c65f953
commit 77b197fb1c
2 changed files with 13 additions and 8 deletions

View File

@ -101,13 +101,13 @@ namespace Bit.Api
.AddTokenProvider<EmailTokenProvider<User>>(TokenOptions.DefaultEmailProvider);
var jwtIdentityOptions = provider.GetRequiredService<IOptions<JwtBearerIdentityOptions>>().Value;
services.AddAuthorization(auth =>
services.AddAuthorization(config =>
{
auth.AddPolicy("Application", new AuthorizationPolicyBuilder()
config.AddPolicy("Application", new AuthorizationPolicyBuilder()
.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
.RequireAuthenticatedUser().RequireClaim(ClaimTypes.AuthenticationMethod, jwtIdentityOptions.AuthenticationMethod).Build());
auth.AddPolicy("TwoFactor", new AuthorizationPolicyBuilder()
config.AddPolicy("TwoFactor", new AuthorizationPolicyBuilder()
.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
.RequireAuthenticatedUser().RequireClaim(ClaimTypes.AuthenticationMethod, jwtIdentityOptions.TwoFactorAuthenticationMethod).Build());
});
@ -120,13 +120,16 @@ namespace Bit.Api
services.AddScoped<IUserService, UserService>();
// Cors
services.AddCors(o => o.AddPolicy("All", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
services.AddCors(config =>
{
config.AddPolicy("All", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin());
});
// MVC
services.AddMvc(o =>
services.AddMvc(config =>
{
o.Filters.Add(new ExceptionHandlerFilterAttribute());
o.Filters.Add(new ModelStateValidationFilterAttribute());
config.Filters.Add(new ExceptionHandlerFilterAttribute());
config.Filters.Add(new ModelStateValidationFilterAttribute());
});
}

View File

@ -1,4 +1,6 @@
function dirtyCiphers(userId) {
// Update all ciphers for a user to be dirty
function dirtyCiphers(userId) {
var collection = getContext().getCollection();
var collectionLink = collection.getSelfLink();
var response = getContext().getResponse();