mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-05-14 11:58:06 +02:00
api: remove unnecessary auth policies
This commit is contained in:
@@ -107,23 +107,13 @@ namespace Notesnook.API
|
||||
policy.RequireAuthenticatedUser();
|
||||
policy.Requirements.Add(new SyncRequirement());
|
||||
});
|
||||
options.AddPolicy("Verified", policy =>
|
||||
{
|
||||
policy.AuthenticationSchemes.Add("introspection");
|
||||
policy.RequireAuthenticatedUser();
|
||||
policy.Requirements.Add(new EmailVerifiedRequirement());
|
||||
});
|
||||
options.AddPolicy("Pro", policy =>
|
||||
{
|
||||
policy.AuthenticationSchemes.Add("introspection");
|
||||
policy.RequireAuthenticatedUser();
|
||||
policy.Requirements.Add(new SyncRequirement());
|
||||
policy.Requirements.Add(new ProUserRequirement());
|
||||
});
|
||||
options.AddPolicy("BasicAdmin", policy =>
|
||||
{
|
||||
policy.AuthenticationSchemes.Add("BasicAuthentication");
|
||||
policy.RequireClaim(ClaimTypes.Role, "Admin");
|
||||
});
|
||||
|
||||
options.DefaultPolicy = options.GetPolicy("Notesnook");
|
||||
}).AddSingleton<IAuthorizationMiddlewareResultHandler, AuthorizationResultTransformer>(); ;
|
||||
|
||||
Reference in New Issue
Block a user