mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(api): ♻️ Remove useless authorization checks
This commit is contained in:
parent
dc12b269f5
commit
09f30db83a
59 changed files with 103 additions and 839 deletions
|
|
@ -40,14 +40,6 @@ export default (plugin: PluginType): void => {
|
|||
},
|
||||
},
|
||||
},
|
||||
401: {
|
||||
description: "Unauthorized",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: ErrorSchema,
|
||||
},
|
||||
},
|
||||
},
|
||||
404: {
|
||||
description: "Account not found",
|
||||
content: {
|
||||
|
|
@ -62,10 +54,6 @@ export default (plugin: PluginType): void => {
|
|||
const { id: issuerId } = context.req.valid("param");
|
||||
const { user } = context.get("auth");
|
||||
|
||||
if (!user) {
|
||||
throw new ApiError(401, "Unauthorized");
|
||||
}
|
||||
|
||||
const issuer = context
|
||||
.get("pluginConfig")
|
||||
.providers.find((provider) => provider.id === issuerId);
|
||||
|
|
@ -126,14 +114,6 @@ export default (plugin: PluginType): void => {
|
|||
204: {
|
||||
description: "Account unlinked",
|
||||
},
|
||||
401: {
|
||||
description: "Unauthorized",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: ErrorSchema,
|
||||
},
|
||||
},
|
||||
},
|
||||
404: {
|
||||
description: "Account not found",
|
||||
content: {
|
||||
|
|
@ -148,10 +128,6 @@ export default (plugin: PluginType): void => {
|
|||
const { id: issuerId } = context.req.valid("param");
|
||||
const { user } = context.get("auth");
|
||||
|
||||
if (!user) {
|
||||
throw new ApiError(401, "Unauthorized");
|
||||
}
|
||||
|
||||
// Check if issuer exists
|
||||
const issuer = context
|
||||
.get("pluginConfig")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue