prevent login and password reset for system accounts

This commit is contained in:
Hazel K 2024-10-07 14:58:39 -04:00
parent 126a2fcf15
commit cd9bce3072
8 changed files with 45 additions and 1 deletions

View file

@ -77,6 +77,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { query, extractDomain } from '@/scripts/url.js';
import { login } from '@/account.js';
import { i18n } from '@/i18n.js';
import { showSystemAccountDialog } from '@/scripts/show-system-account-dialog.js';
const signing = ref(false);
const user = ref<Misskey.entities.UserDetailed | null>(null);
@ -204,6 +205,10 @@ function loginFailed(err: any): void {
showSuspendedDialog();
break;
}
case 's8dhsj9s-a93j-493j-ja9k-kas9sj20aml2': {
showSystemAccountDialog();
break;
}
case '22d05606-fbcf-421a-a2db-b32610dcfd1b': {
os.alert({
type: 'error',

View file

@ -83,7 +83,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="markedAsNSFW" @update:modelValue="toggleNSFW">{{ i18n.ts.markAsNSFW }}</MkSwitch>
<div>
<MkButton v-if="user.host == null" inline style="margin-right: 8px;" @click="resetPassword"><i class="ti ti-key"></i> {{ i18n.ts.resetPassword }}</MkButton>
<MkButton v-if="user.host == null && !isSystem" inline style="margin-right: 8px;" @click="resetPassword"><i class="ti ti-key"></i> {{ i18n.ts.resetPassword }}</MkButton>
</div>
<MkFolder>

View file

@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
export function showSystemAccountDialog(): Promise<void> {
return os.alert({
type: 'error',
title: i18n.ts.systemAccountTitle,
text: i18n.ts.systemAccountDescription,
});
}