mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-10-01 18:49:42 +02:00
api: remove unnecessary auth policies
This commit is contained in:
1 parent
99f095babe
commit
f5bb5d0716
2 files changed
+1
-47
No files matched your search
@@ -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