Skip to content

Commit 0506bff

Browse files
authored
Merge pull request #306 from OpenGeoscience/logouts
Complete logouts with allauth logout page
2 parents c545946 + 5396676 commit 0506bff

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

web/src/api/auth.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from "axios";
22
import OauthClient from "@resonant/oauth-client";
33
import S3FileFieldClient from 'django-s3-file-field';
4-
import { useAppStore, useMapStore, useProjectStore } from "@/store";
4+
import { useAppStore } from "@/store";
55

66
const OAUTH2_CLIENT_ID = 'cBmD6D6F2YAmMWHNQZFPUr4OpaXVpW5w4Thod6Kj';
77

@@ -73,11 +73,5 @@ apiClient.interceptors.response.use(
7373

7474
export const logout = async () => {
7575
await oauthClient.logout();
76-
77-
useAppStore().currentUser = undefined;
78-
79-
useProjectStore().currentProject = undefined;
80-
useProjectStore().clearState();
81-
82-
useMapStore().setMapCenter();
76+
window.location.href = `${import.meta.env.VITE_APP_API_ROOT}accounts/logout/`
8377
};

web/src/components/sidebars/SideBars.vue

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,10 @@ watch(darkMode, () => {
110110
<v-icon v-bind="props" icon="mdi-cog" class="px-3"></v-icon>
111111
</template>
112112
<v-list>
113-
<v-list-item density="compact">
113+
<v-list-item density="compact" @click="logout">
114114
Logout
115115
<template v-slot:append>
116116
<v-icon icon="mdi-logout"></v-icon>
117-
<v-dialog activator="parent" max-width="300">
118-
<template v-slot:default="{ isActive }">
119-
<v-card class="pa-3">
120-
<v-card-title>Log out?</v-card-title>
121-
<v-btn @click="isActive.value = false" text="Cancel" />
122-
<v-btn @click="logout" color="red" text="Confirm" />
123-
</v-card>
124-
</template>
125-
</v-dialog>
126117
</template>
127118
</v-list-item>
128119
<v-list-item density="compact">

0 commit comments

Comments
 (0)