mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-01 05:23:10 -05:00
fix: disable invitations when password login is disabled (#6781)
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
{{ $t("general.create") }}
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="$appInfo.allowPasswordLogin"
|
||||
class="mr-2"
|
||||
color="info"
|
||||
:icon="$globals.icons.link"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user