From 983f91eb1cf264c7709219a05f7cd5b0d72821f0 Mon Sep 17 00:00:00 2001 From: "dmitriy.churmeev" Date: Sun, 29 Mar 2026 14:07:15 +0300 Subject: [PATCH] fix security configuration --- src/main/kotlin/com/test/test/rest/TestController.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/kotlin/com/test/test/rest/TestController.kt b/src/main/kotlin/com/test/test/rest/TestController.kt index 17ea779..ddd9f8a 100644 --- a/src/main/kotlin/com/test/test/rest/TestController.kt +++ b/src/main/kotlin/com/test/test/rest/TestController.kt @@ -16,6 +16,16 @@ class TestController { return "Test page" } + @GetMapping("/debug") + fun debug(): Map { + val auth = SecurityContextHolder.getContext().authentication + return mapOf( + "isAuthenticated" to auth.isAuthenticated, + "name" to auth.name, + "authorities" to auth.authorities.map { it.authority } + ) + } + @PreAuthorize("hasRole('USER')") @GetMapping("/users") fun users(): ArrayList {