Skip to content

Commit

Permalink
added apiClient.logout and checking for token
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuevIO committed Sep 30, 2024
1 parent 7bb3e89 commit b1f199e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api/controllers/auth/AuthApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class AuthApi {
const profileStore = useProfileStore();
const toastStore = useToastStore();
profileStore.deleteToken();
await apiClient.POST('/auth/logout');
router.push('/auth');
toastStore.push({
title: 'Вы успешно вышли из аккаунта',
Expand Down
4 changes: 4 additions & 0 deletions src/views/auth/AuthView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import ForgotPassordForm from '@/components/ForgotPassordForm.vue';
import IrdomAuthButton from '@/components/IrdomAuthButton.vue';
import { authButtons } from '@/constants/authButtons';
import { ref } from 'vue';
import { useProfileStore } from '@/store/profile';
const profileStore = useProfileStore();
const toolbar = useToolbar();
Expand Down Expand Up @@ -38,6 +41,7 @@ const switchState = async (to: Step) => {
}
};
console.log(profileStore.token);
toolbar.setup({ title: 'Вход в профиль' });
</script>

Expand Down

0 comments on commit b1f199e

Please sign in to comment.