remove keycloak change use cookie only

This commit is contained in:
Warunee Tamkoo 2024-08-28 11:14:21 +07:00
parent 24374ab8f2
commit 92b85ce4ef
23 changed files with 236 additions and 189 deletions

View file

@ -4,10 +4,11 @@ import config from "@/app.config";
import { onMounted, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useQuasar } from "quasar";
import keycloak, { kcLogout } from "@/plugins/keycloak";
import { useCounterMixin } from "@/stores/mixin";
import CustomComponent from "@/components/CustomDialog.vue";
import avatar from "@/assets/avatar_user.jpg";
import { tokenParsed, logout } from "@/plugins/auth";
const route = useRoute();
const router = useRouter();
@ -36,9 +37,8 @@ const link = ref<string>("");
*/
onMounted(async () => {
await fetchTotolNotificate();
if (keycloak.tokenParsed != null) {
fullname.value = keycloak.tokenParsed.name;
}
const user = await tokenParsed();
fullname.value = user?.name;
});
async function checkUser() {
@ -65,7 +65,7 @@ async function checkUser() {
},
}).onCancel(async () => {
showLoader();
await kcLogout();
await logout();
setTimeout(() => {
hideLoader();
}, 1000);
@ -132,15 +132,15 @@ const fetchlistNotification = async (index: number, type: string) => {
};
/**
* logout keycloak
* logout
* confirm อนออกจากระบบ
*/
const doLogout = () => {
dialogConfirm(
$q,
async () => {
// authen with keycloak client
kcLogout();
// authen with client
logout();
},
"ยืนยันการออกจากระบบ",
"ต้องการออกจากระบบใช่หรือไม่"
@ -456,14 +456,14 @@ function onInfo() {
>
</q-item>
<q-item clickable v-close-popup>
<!-- <q-item clickable v-close-popup>
<q-item-section avatar style="min-width: 30px">
<q-icon color="orange-9" size="18px" name="mdi-lock-outline" />
</q-item-section>
<q-item-section
><q-item-label>เปลยนรหสผาน</q-item-label></q-item-section
>
</q-item>
</q-item> -->
<q-item clickable v-close-popup @click="doLogout">
<q-item-section avatar style="min-width: 30px">