remove keycloak use cookie auth
This commit is contained in:
parent
035db71697
commit
5a5e37c12d
27 changed files with 501 additions and 440 deletions
|
|
@ -12,13 +12,13 @@ import type {
|
|||
SupportMessageStatus,
|
||||
SupportIssueCategoryResponse,
|
||||
} from "@/modules/00_support/interface/index/Main";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import { useQuasar } from "quasar";
|
||||
import { getToken, tokenParsed } from "@/plugins/auth";
|
||||
|
||||
export const useSupportStore = defineStore("supportServiceStore", () => {
|
||||
export const useSupportStore = defineStore("supportServiceStore", async () => {
|
||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const userId = ref<string | undefined>(keycloak.subject);
|
||||
const userId = ref<string | undefined>("");
|
||||
const issue = ref<SupportIssueResponse>();
|
||||
const message = ref<SupportMessageResponse>();
|
||||
const messageStatus = ref<SupportMessageStatus>();
|
||||
|
|
@ -44,8 +44,9 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
|
|||
}, 150);
|
||||
}
|
||||
|
||||
const token = await getToken();
|
||||
const socket = io(config.API.supportSocket, {
|
||||
auth: { token: keycloak.token },
|
||||
auth: { token: token },
|
||||
autoConnect: false,
|
||||
path: "/api/v1/support/socket/",
|
||||
});
|
||||
|
|
@ -54,7 +55,10 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
|
|||
userStatus.value = data;
|
||||
});
|
||||
|
||||
socket.on("online", (r) => {
|
||||
socket.on("online", async (r) => {
|
||||
const user = await tokenParsed();
|
||||
userId.value = user.subject;
|
||||
|
||||
userStatus.value.push({
|
||||
socketId: r.socketId,
|
||||
userId: r.userId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue