archesproject / arches-lingo

Arches Reference Data Manager Application
GNU Affero General Public License v3.0
0 stars 0 forks source link

prevents stale user after logout #70 #71

Closed chrabyrd closed 3 weeks ago

chrabyrd commented 3 weeks ago

Actually, I'm showing this is fixed with just:

diff --git a/arches_lingo/src/arches_lingo/components/user/UserInteraction.vue b/arches_lingo/src/arches_lingo/components/user/UserInteraction.vue
index 9361665..def4c3e 100644
--- a/arches_lingo/src/arches_lingo/components/user/UserInteraction.vue
+++ b/arches_lingo/src/arches_lingo/components/user/UserInteraction.vue
@@ -20,11 +20,12 @@ const { $gettext } = useGettext();
 const toast = useToast();
 const router = useRouter();

-const { user } = inject(USER_KEY) as UserRefAndSetter;
+const { user, setUser } = inject(USER_KEY) as UserRefAndSetter;

 const issueLogout = async () => {
     try {
         await logout();
+        setUser(null);
         router.push({ name: routeNames.login });
     } catch (error) {
         toast.add({

True, but then we lose the feature of dealing with if a user has logged out in the Arches (not lingo) application. I know requesting the user every page isn't ideal but IMO it's better/safer.

jacobtylerwalls commented 3 weeks ago

Ah, I forgot about that case. Approving!