frontend/classes/repo/WebsocketSession.ts
2025-11-08 10:41:33 +01:00

16 lines
417 B
TypeScript

import axios from "axios";
export class WebsocketSession
{
static get(onSucces: (token: string) => void)
{
axios.post<string>(ApiConfig.getHttpBase() + '/websocket-session', undefined, {
headers: {
Authorization: StringUtils.format("Bearer %s", requireToken())
}
})
.then((response) => {
onSucces(response.data);
});
}
}