diff --git a/schema.yml b/schema.yml index 83460a3f21..f3a6541071 100644 --- a/schema.yml +++ b/schema.yml @@ -3013,34 +3013,6 @@ paths: $ref: '#/components/responses/ValidationErrorResponse' '403': $ref: '#/components/responses/GenericErrorResponse' - /core/authenticated_sessions/bulk_delete/: - delete: - operationId: core_authenticated_sessions_bulk_delete - description: Bulk revoke all sessions for multiple users - parameters: - - in: query - name: user_pks - schema: - type: array - items: - type: integer - description: List of user IDs to revoke all sessions for - required: true - tags: - - core - security: - - authentik: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SessionDeleteResponse' - description: '' - '400': - $ref: '#/components/responses/ValidationErrorResponse' - '403': - $ref: '#/components/responses/GenericErrorResponse' /core/authenticated_sessions/{uuid}/: get: operationId: core_authenticated_sessions_retrieve @@ -3116,6 +3088,34 @@ paths: $ref: '#/components/responses/ValidationErrorResponse' '403': $ref: '#/components/responses/GenericErrorResponse' + /core/authenticated_sessions/bulk_delete/: + delete: + operationId: core_authenticated_sessions_bulk_delete_destroy + description: Bulk revoke all sessions for multiple users + parameters: + - in: query + name: user_pks + schema: + type: array + items: + type: integer + description: List of user IDs to revoke all sessions for + required: true + tags: + - core + security: + - authentik: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDeleteSessionResponse' + description: '' + '400': + $ref: '#/components/responses/ValidationErrorResponse' + '403': + $ref: '#/components/responses/GenericErrorResponse' /core/brands/: get: operationId: core_brands_list @@ -34725,17 +34725,6 @@ components: - orphaned - unknown type: string - BulkDeleteSession: - type: object - description: Serializer for bulk deleting authenticated sessions by user - properties: - user_ids: - type: array - items: - type: integer - description: List of user IDs to revoke all sessions for - required: - - user_pks Brand: type: object description: Brand Serializer @@ -34878,6 +34867,13 @@ components: additionalProperties: {} required: - domain + BulkDeleteSessionResponse: + type: object + properties: + deleted: + type: integer + required: + - deleted Cache: type: object description: Generic cache stats for an object @@ -53288,15 +53284,6 @@ components: required: - healthy - version - SessionDeleteResponse: - type: object - description: Response for bulk session deletion - properties: - deleted: - type: integer - description: Number of sessions deleted - required: - - deleted SessionEndChallenge: type: object description: Challenge for ending a session diff --git a/web/src/admin/files/FileUploadForm.ts b/web/src/admin/files/FileUploadForm.ts index b62148824b..23cac6934f 100644 --- a/web/src/admin/files/FileUploadForm.ts +++ b/web/src/admin/files/FileUploadForm.ts @@ -45,12 +45,6 @@ function getFileExtension(fileName: string): string { return fileName.slice(lastDot); } -function hasBasenameExtension(fileName: string): boolean { - const baseName = fileName.split("/").pop() ?? fileName; - const lastDot = baseName.lastIndexOf("."); - return lastDot > 0; -} - @customElement("ak-file-upload-form") export class FileUploadForm extends Form> { @property({ type: String, useDefault: true }) @@ -89,17 +83,10 @@ export class FileUploadForm extends Form> { const api = new AdminApi(DEFAULT_CONFIG); const customName = typeof data.name === "string" ? data.name.trim() : ""; - // If custom name provided, validate and append original extension - // Only validate the original filename if no custom name is provided - let finalName = this.selectedFile.name; - if (customName) { - assertValidFileName(customName); - const ext = getFileExtension(this.selectedFile.name); - finalName = - ext && !hasBasenameExtension(customName) ? `${customName}${ext}` : customName; - } else { - assertValidFileName(this.selectedFile.name); - } + // If custom name provided, append original file extension; otherwise use original filename + const finalName = customName + ? `${customName}${getFileExtension(this.selectedFile.name)}` + : this.selectedFile.name; assertValidFileName(finalName); diff --git a/web/src/admin/users/UserBulkRevokeSessionsForm.ts b/web/src/admin/users/UserBulkRevokeSessionsForm.ts index 96f1f69e12..b2cfbe4332 100644 --- a/web/src/admin/users/UserBulkRevokeSessionsForm.ts +++ b/web/src/admin/users/UserBulkRevokeSessionsForm.ts @@ -107,7 +107,7 @@ export class UserBulkRevokeSessionsForm extends ModalButton { if (userIds.length > 0) { const response = await new CoreApi( DEFAULT_CONFIG, - ).coreAuthenticatedSessionsBulkDelete({ + ).coreAuthenticatedSessionsBulkDeleteDestroy({ userPks: userIds, }); this.revokedCount = response.deleted || 0;