Skip to content

Commit

Permalink
make auth suck less
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Sep 30, 2024
1 parent e79976e commit fc26934
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 182 deletions.
134 changes: 56 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@types/api-error-handler": "^1.0.36",
"@types/body-parser": "^1.19.5",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^22.5.5",
"@types/node": "^22.7.4",
"@types/response-time": "^2.3.8",
"@types/statuses": "^2.0.5",
"@types/swagger-ui-express": "^4.1.6",
Expand All @@ -45,12 +45,12 @@
"body-parser": "^1.20.3",
"cloudflare": "^3.5.0",
"cors": "^2.8.5",
"discord-api-types": "^0.37.100",
"discord-api-types": "^0.37.101",
"dotenv": "^16.4.5",
"express": "^4.21.0",
"firestorm-db": "^1.13.0",
"form-data": "^4.0.0",
"isomorphic-dompurify": "^2.15.0",
"isomorphic-dompurify": "^2.16.0",
"multer": "^1.4.5-lts.1",
"response-time": "^2.3.2",
"statuses": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/v2/controller/addon.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class AddonController extends Controller {
@Response<PermissionError>(403)
@Security("discord", ["addon:approved", "administrator"])
@Get("{id_or_slug}")
public async getAddon(@Path() id_or_slug: string): Promise<Addon | Addons> {
public async getAddon(@Path() id_or_slug: string | AddonStatus): Promise<Addon | Addons> {
if (AddonStatusValues.includes(id_or_slug as AddonStatus))
return this.getAddonsByStatus(id_or_slug as AddonStatus);
const [, addon] = await this.service.getAddonFromSlugOrId(id_or_slug);
Expand Down
1 change: 0 additions & 1 deletion src/v2/controller/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ export class UserController extends Controller {
*/
@Delete("{id}")
@Security("discord", ["account:delete", "administrator"])
@Security("bot")
public delete(@Path() id: string): Promise<WriteConfirmation> {
return this.userService.delete(id);
}
Expand Down
Loading

0 comments on commit fc26934

Please sign in to comment.