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

@@ -35,6 +35,7 @@
{{ $t("general.create") }}
</BaseButton>
<BaseButton
v-if="$appInfo.allowPasswordLogin"
class="mr-2"
color="info"
:icon="$globals.icons.link"

View File

@@ -26,7 +26,7 @@
<ToggleState tag="article">
<template #activator="{ toggle, state }">
<v-btn
v-if="!state"
v-if="!state && $appInfo.allowPasswordLogin"
color="info"
class="mt-2 mb-n3"
@click="toggle"
@@ -37,7 +37,7 @@
{{ $t("settings.change-password") }}
</v-btn>
<v-btn
v-else
v-else-if="$appInfo.allowPasswordLogin"
color="info"
class="mt-2 mb-n3"
@click="toggle"
@@ -111,7 +111,7 @@
class="mt-10"
:title="$t('settings.change-password')"
/>
<v-card variant="outlined">
<v-card variant="outlined" style="border-color: lightgrey;">
<v-card-text class="pb-0">
<v-form ref="passChange">
<v-text-field

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();