fix: disable invitations when password login is disabled (#6781)

This commit is contained in:
Arsène Reymond
2026-01-30 21:05:40 +01:00
committed by GitHub
parent 731ee8ae3d
commit c7be4a452a
5 changed files with 53 additions and 13 deletions

View File

@@ -295,6 +295,7 @@ export default defineNuxtComponent({
async setup() {
const i18n = useI18n();
const $auth = useMealieAuth();
const { $appInfo } = useNuxtApp();
const route = useRoute();
const groupSlug = computed(() => route.params.groupSlug || $auth.user.value?.groupSlug || "");
@@ -302,7 +303,18 @@ export default defineNuxtComponent({
title: i18n.t("settings.profile"),
});
const user = computed<UserOut | null>(() => $auth.user.value);
const user = computed<UserOut | null>(() => {
const authUser = $auth.user.value;
if (!authUser) return null;
// Override canInvite if password login is disabled
const canInvite = !$appInfo.allowPasswordLogin ? false : authUser.canInvite;
return {
...authUser,
canInvite,
};
});
const inviteDialog = ref(false);
const api = useUserApi();