Is the websockets fully working now? Admin users should be able to connect, subscribe and send messages through websockets but regular users should only be able to connect and subscribe, not send messages over websockets. I've tried it in postman and this is what i get in my backend terminal:

2024-12-02T08:20:36.942+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] c.f.ecommerce.backend.Application        : Starting Application using Java 17.0.11 with PID 45048 (C:\Users\hassa\Documents\ecommerce.backend\target\classes started by hassa in C:\Users\hassa\Documents\ecommerce.backend)
2024-12-02T08:20:36.945+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] c.f.ecommerce.backend.Application        : Running with Spring Boot v3.3.5, Spring v6.1.14
2024-12-02T08:20:36.946+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] c.f.ecommerce.backend.Application        : No active profile set, falling back to 1 default profile: "default"
2024-12-02T08:20:36.987+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2024-12-02T08:20:36.988+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2024-12-02T08:20:37.839+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2024-12-02T08:20:37.906+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 58 ms. Found 7 JPA repository interfaces.    
2024-12-02T08:20:38.664+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2024-12-02T08:20:38.689+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-12-02T08:20:38.689+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.31]
2024-12-02T08:20:38.761+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-12-02T08:20:38.762+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1774 ms
2024-12-02T08:20:39.251+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2024-12-02T08:20:39.348+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.5.3.Final
2024-12-02T08:20:39.413+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.h.c.internal.RegionFactoryInitiator    : HHH000026: Second-level cache disabled
2024-12-02T08:20:39.640+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.o.j.p.SpringPersistenceUnitInfo      : No LoadTimeWeaver setup: ignoring JPA class transformer
2024-12-02T08:20:39.665+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2024-12-02T08:20:39.888+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection ConnectionID:1 ClientConnectionId: cc423909-ff4c-4988-888b-719bd9e86deb
2024-12-02T08:20:39.889+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.    
2024-12-02T08:20:39.915+01:00  WARN 45048 --- [ecommerce.backend] [  restartedMain] org.hibernate.orm.deprecation            : HHH90000025: SQLServerDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2024-12-02T08:20:40.865+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2024-12-02T08:20:43.091+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2024-12-02T08:20:43.637+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] c.f.e.b.api.security.JWTRequestFilter    : Filter 'JWTRequestFilter' configured for use
2024-12-02T08:20:44.339+01:00  WARN 45048 --- [ecommerce.backend] [  restartedMain] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2024-12-02T08:20:44.412+01:00  WARN 45048 --- [ecommerce.backend] [  restartedMain] .s.s.UserDetailsServiceAutoConfiguration :

Using generated security password: 21fd4cb3-06be-48ff-948c-6077b555fdcc

This generated password is for development use only. Your security configuration must be updated before running your application in production.

2024-12-02T08:20:44.449+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with UserDetailsService bean with name inMemoryUserDetailsManager
2024-12-02T08:20:44.587+01:00 TRACE 45048 --- [ecommerce.backend] [  restartedMain] o.s.w.s.s.s.WebSocketHandlerMapping      : No patterns in 'webSocketHandlerMapping'
2024-12-02T08:20:44.692+01:00 TRACE 45048 --- [ecommerce.backend] [  restartedMain] o.s.w.s.s.s.WebSocketHandlerMapping      : Mapped [/websocket/**] onto org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler@124772bb
2024-12-02T08:20:44.693+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.w.s.s.s.WebSocketHandlerMapping      : Patterns [/websocket/**] in 'stompWebSocketHandlerMapping'
2024-12-02T08:20:45.195+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint beneath base path '/actuator'
2024-12-02T08:20:45.339+01:00 TRACE 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler : Looking for @MessageExceptionHandler mappings: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@52c86c7e, started on Mon Dec 02 08:20:36 CET 2024     
2024-12-02T08:20:45.351+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.a.AuthenticationController:       

2024-12-02T08:20:45.353+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.CartController:

2024-12-02T08:20:45.354+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.ImageController:

2024-12-02T08:20:45.354+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.o.OrderController:

2024-12-02T08:20:45.354+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.p.ProductController:

2024-12-02T08:20:45.354+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.u.UserController:

2024-12-02T08:20:45.362+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.c.WebsocketController:
        {[MESSAGE],[/sendMessage]}: handleMessage(ChatMessage,String,StompHeaderAccessor)
        {[MESSAGE],[/admin/message]}: handleAdminMessage(ChatMessage,String,StompHeaderAccessor)
        {[MESSAGE],[/test]}: handleTest(String)       
2024-12-02T08:20:45.363+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        c.f.e.b.a.s.WebSocketController:
        {[MESSAGE],[/profile]}: handleProfile(String) 
2024-12-02T08:20:45.365+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] .WebSocketAnnotationMethodMessageHandler :
        o.s.b.a.w.s.e.BasicErrorController:

2024-12-02T08:20:45.772+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2024-12-02T08:20:45.848+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/'
2024-12-02T08:20:45.850+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.ExecutorSubscribableChannel      : clientOutboundChannel added SubProtocolWebSocketHandler[StompSubProtocolHandler[v10.stomp, v11.stomp, v12.stomp]]
2024-12-02T08:20:45.850+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.ExecutorSubscribableChannel      : clientInboundChannel added WebSocketAnnotationMethodMessageHandler[prefixes=[/app/]]     
2024-12-02T08:20:45.851+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.b.SimpleBrokerMessageHandler     : Starting...
2024-12-02T08:20:45.852+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.ExecutorSubscribableChannel      : clientInboundChannel added SimpleBrokerMessageHandler [org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry@7aca3979]
2024-12-02T08:20:45.852+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.ExecutorSubscribableChannel      : brokerChannel added SimpleBrokerMessageHandler [org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry@7aca3979]
2024-12-02T08:20:45.853+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.b.SimpleBrokerMessageHandler     : BrokerAvailabilityEvent[available=true, SimpleBrokerMessageHandler [org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry@7aca3979]]
2024-12-02T08:20:45.854+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.b.SimpleBrokerMessageHandler     : Started.
2024-12-02T08:20:45.855+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.ExecutorSubscribableChannel      : clientInboundChannel added UserDestinationMessageHandler[DefaultUserDestinationResolver[prefix=/user/]]
2024-12-02T08:20:45.855+01:00 DEBUG 45048 --- [ecommerce.backend] [  restartedMain] o.s.m.s.ExecutorSubscribableChannel      : brokerChannel added UserDestinationMessageHandler[DefaultUserDestinationResolver[prefix=/user/]]
2024-12-02T08:20:45.865+01:00  INFO 45048 --- [ecommerce.backend] [  restartedMain] c.f.ecommerce.backend.Application        : Started Application in 9.259 seconds (process running for 9.711)
2024-12-02T08:20:45.883+01:00  INFO 45048 --- [ecommerce.backend] [on(2)-127.0.0.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-12-02T08:20:45.883+01:00  INFO 45048 --- [ecommerce.backend] [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-12-02T08:20:45.884+01:00  INFO 45048 --- [ecommerce.backend] [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms   
2024-12-02T08:21:45.795+01:00  INFO 45048 --- [ecommerce.backend] [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 0 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
2024-12-02T08:22:28.989+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-4] o.s.w.s.s.s.WebSocketHandlerMapping      : Mapped to HandlerExecutionChain with [org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler@124772bb] and 1 interceptors      
2024-12-02T08:22:28.990+01:00 DEBUG 45048 --- [ecommerce.backend] [nio-8080-exec-4] o.s.w.s.s.t.h.DefaultSockJsService       : Processing transport request: GET http://localhost:8080/websocket/websocket
2024-12-02T08:22:28.993+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-4] o.s.w.s.s.s.DefaultHandshakeHandler      : Processing request http://localhost:8080/websocket/websocket with headers=[sec-websocket-version:"13", sec-websocket-key:"GryhNuGWUs/FwBkyTw/T1g==", connection:"Upgrade", upgrade:"websocket", authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiVVNFUiIsImlzcyI6ImVDb21tZXJjZSIsIlVTRVJOQU1FIjoiaGVsbG8iLCJleHAiOjE3MzM3Mjg4NTV9.moN2ur9jK1ADxbf9mc6vPXtY1J6GX-SWnL4oCfPOhXQ", destination:"/app/sendMessage", sec-websocket-extensions:"permessage-deflate; client_max_window_bits", host:"localhost:8080", Content-Type:"application/json;charset=UTF-8"]
2024-12-02T08:22:28.994+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-4] o.s.w.s.s.s.DefaultHandshakeHandler      : Upgrading to WebSocket, subProtocol=null, extensions=[]
2024-12-02T08:22:29.020+01:00 DEBUG 45048 --- [ecommerce.backend] [nio-8080-exec-4] s.w.s.h.LoggingWebSocketHandlerDecorator : New StandardWebSocketSession[id=7cabcfc6-a014-979b-3bec-262a83f05c3e, uri=ws://localhost:8080/websocket/websocket]
2024-12-02T08:22:29.023+01:00  INFO 45048 --- [ecommerce.backend] [nio-8080-exec-4] c.f.e.b.a.s.WebSocketSessionRegistry     : Session registered for user: hello 
2024-12-02T08:22:30.513+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-6] s.w.s.h.LoggingWebSocketHandlerDecorator : Handling TextMessage payload=[CONNECT
a..], byteCount=251, last=true] in StandardWebSocketSession[id=7cabcfc6-a014-979b-3bec-262a83f05c3e, uri=ws://localhost:8080/websocket/websocket]
2024-12-02T08:22:30.516+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-6] o.s.messaging.simp.stomp.StompDecoder    : Decoded CONNECT {accept-version=[1.1,1.0], heart-beat=[10000,10000], Authorization=[Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiVVNFUiIsImlzcyI6ImVDb21tZXJjZSIsIlVTRVJOQU1FIjoiaGVsbG8iLCJleHAiOjE3MzM3Mjg4NTV9.moN2ur9jK1ADxbf9mc6vPXtY1J6GX-SWnL4oCfPOhXQ]} session=null
2024-12-02T08:22:30.517+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-6] o.s.w.s.m.StompSubProtocolHandler        : From client: CONNECT user=hello session=7cabcfc6-a014-979b-3bec-262a83f05c3e
2024-12-02T08:22:30.523+01:00 DEBUG 45048 --- [ecommerce.backend] [nio-8080-exec-6] c.f.e.b.a.s.WebSocketChannelInterceptor  : Processing CONNECT command
2024-12-02T08:22:30.523+01:00  INFO 45048 --- [ecommerce.backend] [nio-8080-exec-6] c.f.e.b.a.s.WebSocketChannelInterceptor  : User hello connected
2024-12-02T08:22:30.524+01:00 DEBUG 45048 --- [ecommerce.backend] [nboundChannel-2] o.s.m.s.b.SimpleBrokerMessageHandler     : Processing CONNECT user=hello session=7cabcfc6-a014-979b-3bec-262a83f05c3e
2024-12-02T08:22:30.528+01:00 TRACE 45048 --- [ecommerce.backend] [tboundChannel-1] o.s.messaging.simp.stomp.StompEncoder    : Encoding STOMP CONNECTED, headers={version=[1.1], heart-beat=[25000,25000], user-name=[hello]}
2024-12-02T08:22:30.528+01:00 TRACE 45048 --- [ecommerce.backend] [tboundChannel-1] o.s.w.s.adapter.NativeWebSocketSession   : Sending TextMessage payload=[CONNECTED
..], byteCount=63, last=true], StandardWebSocketSession[id=7cabcfc6-a014-979b-3bec-262a83f05c3e, uri=ws://localhost:8080/websocket/websocket]
2024-12-02T08:22:53.809+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-5] s.w.s.h.LoggingWebSocketHandlerDecorator : Handling TextMessage payload=[SUBSC..], byteCount=55, last=true] in StandardWebSocketSession[id=7cabcfc6-a014-979b-3bec-262a83f05c3e, uri=ws://localhost:8080/websocket/websocket]
2024-12-02T08:22:53.809+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-5] o.s.messaging.simp.stomp.StompDecoder    : Decoded SUBSCRIBE {id=[sub-0], destination=[/topic/user/29/address]} session=null        
2024-12-02T08:22:53.809+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-5] o.s.w.s.m.StompSubProtocolHandler        : From client: SUBSCRIBE /topic/user/29/address id=sub-0 session=7cabcfc6-a014-979b-3bec-262a83f05c3e
2024-12-02T08:22:53.813+01:00 DEBUG 45048 --- [ecommerce.backend] [nio-8080-exec-5] c.f.e.b.a.s.WebSocketSecurityService     : User hello access to channel 29: true
2024-12-02T08:22:53.814+01:00 DEBUG 45048 --- [ecommerce.backend] [nio-8080-exec-5] c.f.e.b.a.s.WebSocketChannelInterceptor  : Processing SUBSCRIBE command       
2024-12-02T08:22:53.814+01:00  INFO 45048 --- [ecommerce.backend] [nio-8080-exec-5] c.f.e.b.a.s.WebSocketChannelInterceptor  : User hello subscribing to /topic/user/29/address
2024-12-02T08:22:53.814+01:00 DEBUG 45048 --- [ecommerce.backend] [nboundChannel-5] o.s.m.s.b.SimpleBrokerMessageHandler     : Processing SUBSCRIBE /topic/user/29/address id=sub-0 session=7cabcfc6-a014-979b-3bec-262a83f05c3e
2024-12-02T08:23:12.960+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-7] s.w.s.h.LoggingWebSocketHandlerDecorator : Handling TextMessage payload=[SEND 
dest..], byteCount=107, last=true] in StandardWebSocketSession[id=7cabcfc6-a014-979b-3bec-262a83f05c3e, uri=ws://localhost:8080/websocket/websocket]
2024-12-02T08:23:12.961+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-7] o.s.messaging.simp.stomp.StompDecoder    : Decoded SEND {destination=[/app/sendMessage], content-type=[application/json]} session=null application/json payload={"userId":29,"content":"test message"}
2024-12-02T08:23:12.961+01:00 TRACE 45048 --- [ecommerce.backend] [nio-8080-exec-7] o.s.w.s.m.StompSubProtocolHandler        : From client: SEND /app/sendMessage session=7cabcfc6-a014-979b-3bec-262a83f05c3e application/json payload={"userId":29,"content":"test message"}
2024-12-02T08:23:12.962+01:00  WARN 45048 --- [ecommerce.backend] [nio-8080-exec-7] c.f.e.b.a.s.WebSocketSecurityInterceptor : Access denied for user: hello      
2024-12-02T08:23:15.888+01:00 TRACE 45048 --- [ecommerce.backend] [tboundChannel-2] o.s.messaging.simp.stomp.StompEncoder    : Encoding heartbeat
2024-12-02T08:23:15.889+01:00 TRACE 45048 --- [ecommerce.backend] [tboundChannel-2] o.s.w.s.adapter.NativeWebSocketSession   : Sending TextMessage payload=[      
], byteCount=1, last=true], StandardWebSocketSession[id=7cabcfc6-a014-979b-3bec-262a83f05c3e, uri=ws://localhost:8080/websocket/websocket]