forked from potsda.mn/mobilizon
feat(front): redirect user to homepage on disconnect when currently on private page
Closes #1278 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
6da0dba0fd
commit
d5a6df9940
|
@ -123,8 +123,8 @@
|
|||
</o-dropdown-item>
|
||||
<o-dropdown-item
|
||||
aria-role="listitem"
|
||||
@click="logout"
|
||||
@keyup.enter="logout"
|
||||
@click="performLogout"
|
||||
@keyup.enter="performLogout"
|
||||
>
|
||||
<span
|
||||
class="block py-2 px-4 text-sm text-zinc-700 dark:text-zinc-200 dark:hover:text-white"
|
||||
|
@ -205,7 +205,7 @@ import { logout } from "../utils/auth";
|
|||
import { displayName } from "../types/actor";
|
||||
import RouteName from "../router/name";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import AccountCircle from "vue-material-design-icons/AccountCircle.vue";
|
||||
import { useCurrentUserClient } from "@/composition/apollo/user";
|
||||
|
@ -217,11 +217,13 @@ import { useMutation } from "@vue/apollo-composable";
|
|||
import { UPDATE_DEFAULT_ACTOR } from "@/graphql/actor";
|
||||
import { changeIdentity } from "@/utils/identity";
|
||||
import { useRegistrationConfig } from "@/composition/apollo/config";
|
||||
import { useProgrammatic } from "@oruga-ui/oruga-next";
|
||||
|
||||
const { currentUser } = useCurrentUserClient();
|
||||
const { currentActor } = useCurrentActorClient();
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const { identities } = useCurrentUserIdentities();
|
||||
const { registrationsOpen, registrationsAllowlist, databaseLogin } =
|
||||
|
@ -269,4 +271,21 @@ onDone(({ data }) => {
|
|||
});
|
||||
|
||||
const showMobileMenu = ref(false);
|
||||
|
||||
const { oruga } = useProgrammatic();
|
||||
|
||||
const performLogout = async () => {
|
||||
console.debug("Logging out client...");
|
||||
await logout();
|
||||
oruga.notification.open({
|
||||
message: t("You have been logged-out"),
|
||||
variant: "success",
|
||||
position: "bottom-right",
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
if (route.meta["requiredAuth"] === true) {
|
||||
return router.push({ name: RouteName.HOME });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -371,7 +371,6 @@
|
|||
"You can add tags by hitting the Enter key or by adding a comma": "You can add tags by hitting the Enter key or by adding a comma",
|
||||
"You can try another search term or drag and drop the marker on the map": "You can try another search term or drag and drop the marker on the map",
|
||||
"You don't follow any instances yet.": "You don't follow any instances yet.",
|
||||
"You have been disconnected": "You have been disconnected",
|
||||
"You have cancelled your participation": "You have cancelled your participation",
|
||||
"You have one event in {days} days.": "You have no events in {days} days | You have one event in {days} days. | You have {count} events in {days} days",
|
||||
"You have one event today.": "You have no events today | You have one event today. | You have {count} events today",
|
||||
|
@ -1563,5 +1562,7 @@
|
|||
"This application asks for the following permissions:": "This application asks for the following permissions:",
|
||||
"This application will be allowed to see all of your events organized, the events you participate to, as well as every data from your groups.": "This application will be allowed to see all of your events organized, the events you participate to, as well as every data from your groups.",
|
||||
"This application will be allowed to publish and manage events, post and manage comments, participate to events, manage all of your groups, including group events, resources, posts and discussions. It will also be allowed to manage your account and profile settings.": "This application will be allowed to publish and manage events, post and manage comments, participate to events, manage all of your groups, including group events, resources, posts and discussions. It will also be allowed to manage your account and profile settings.",
|
||||
"No apps authorized yet": "No apps authorized yet"
|
||||
"No apps authorized yet": "No apps authorized yet",
|
||||
"You have been logged-out": "You have been logged-out",
|
||||
"An “application programming interface” or “API” is a communication protocol that allows software components to communicate with each other. The Mobilizon API, for example, can allow third-party software tools to communicate with Mobilizon instances to carry out certain actions, such as posting events on your behalf, automatically and remotely.": "An “application programming interface” or “API” is a communication protocol that allows software components to communicate with each other. The Mobilizon API, for example, can allow third-party software tools to communicate with Mobilizon instances to carry out certain actions, such as posting events on your behalf, automatically and remotely."
|
||||
}
|
|
@ -1240,7 +1240,6 @@
|
|||
"You don't have any upcoming events. Maybe try another filter?": "Vous n'avez pas d'événements à venir. Essayez peut-être un autre filtre ?",
|
||||
"You excluded member {member}.": "Vous avez exclu le ou la membre {member}.",
|
||||
"You have attended {count} events in the past.": "Vous n'avez participé à aucun événement par le passé.|Vous avez participé à un événement par le passé.|Vous avez participé à {count} événements par le passé.",
|
||||
"You have been disconnected": "Vous avez été déconnecté⋅e",
|
||||
"You have been invited by {invitedBy} to the following group:": "Vous avez été invité par {invitedBy} à rejoindre le groupe suivant :",
|
||||
"You have been removed from this group's members.": "Vous avez été exclu⋅e des membres de ce groupe.",
|
||||
"You have cancelled your participation": "Vous avez annulé votre participation",
|
||||
|
@ -1559,5 +1558,7 @@
|
|||
"This application asks for the following permissions:": "Cette application demande les autorisations suivantes :",
|
||||
"This application will be allowed to see all of your events organized, the events you participate to, as well as every data from your groups.": "Cette application vous permettra de voir tous les événements que vous avez organisés, les événements auxquels vous participez, ainsi que toutes les données de vos groupes.",
|
||||
"This application will be allowed to publish and manage events, post and manage comments, participate to events, manage all of your groups, including group events, resources, posts and discussions. It will also be allowed to manage your account and profile settings.": "Cette application sera autorisée à publier et à gérer des événements, à publier et à gérer des commentaires, à participer à des événements, à gérer tous vos groupes, y compris les événements de groupe, les ressources, les messages et les discussions. Elle pourra également gérer les paramètres de votre compte et de votre profil.",
|
||||
"No apps authorized yet": "Aucune application autorisée pour le moment"
|
||||
"No apps authorized yet": "Aucune application autorisée pour le moment",
|
||||
"You have been logged-out": "Vous avez été déconnecté·e",
|
||||
"An “application programming interface” or “API” is a communication protocol that allows software components to communicate with each other. The Mobilizon API, for example, can allow third-party software tools to communicate with Mobilizon instances to carry out certain actions, such as posting events on your behalf, automatically and remotely.": "Une « interface de programmation d’application » ou « API » est un protocole de communication qui permet aux composants logiciels de communiquer entre eux. L'API Mobilizon, par exemple, peut permettre à des outils logiciels tiers de communiquer avec les instances Mobilizon pour effectuer certaines actions, telles que la publication d'événements en votre nom, automatiquement et à distance."
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue