I am receiving a CSRF token from my backend, putting the CSRF in local storage and then adding that CSRF manually to the headers in the "watch" when I am trying to subscribe to a topic (see below)
this.authenticationService.csrf().pipe(
tap((csrf: Csrf) => {
const connectHeaders = {};
connectHeaders[csrf.headerName] = csrf.token;
this.rxStompService.watch("/topic/notify", connectHeaders).subscribe((message: Message) => {
console.log(JSON.parse(message.body));
});
})
);
My issue is that I am not seeing the CSRF token in the headers. How do I add the CSRF token to the socket connection so that it is sent over in the handshake headers the same way that it is sent over in the an http call.
I am receiving a CSRF token from my backend, putting the CSRF in local storage and then adding that CSRF manually to the headers in the "watch" when I am trying to subscribe to a topic (see below)
My issue is that I am not seeing the CSRF token in the headers. How do I add the CSRF token to the socket connection so that it is sent over in the handshake headers the same way that it is sent over in the an http call.