Refactor permission handling and authentication services

Replaced `PermissionClaim` enum with an OpenAPI-defined schema `PermissionClaimDto` for consistency across frontend and backend. Refactored authentication flow to utilize `AuthService` on the frontend, consolidating JWT handling logic. Removed redundant methods like `saveJwt` and integrated robust permission management throughout the application.
This commit is contained in:
2025-06-21 23:15:46 +02:00
parent 07646e8c42
commit 32a454c034
8 changed files with 144 additions and 60 deletions
+4
View File
@@ -6,6 +6,10 @@ info:
version: 1.0.0
servers:
- url: https://alttd.com/api/v3
components:
schemas:
PermissionClaim:
$ref: './schemas/permissions/permissions.yml#/components/schemas/PermissionClaim'
tags:
- name: history
description: Retrieves punishment history
@@ -0,0 +1,8 @@
components:
schemas:
PermissionClaim:
type: string
enum: [ SCOPE_user, SCOPE_head_mod ]
description: Permission claims used for authorization
x-enum-varnames: [ USER, HEAD_MOD ]
x-enum-descriptions: [ "User permission", "Head moderator permission" ]