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:
@@ -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" ]
|
||||
Reference in New Issue
Block a user