diff options
| author | Marie <github@yuugi.dev> | 2024-10-07 19:34:26 +0000 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2024-10-07 19:34:26 +0000 |
| commit | ba5eec2129f1976c817925a1ec8ef10e23749d84 (patch) | |
| tree | 0c235c30592f7508584452a863ad4ecf2614b921 /packages/backend/src/server/api/SigninApiService.ts | |
| parent | merge: Display instance follow/following relationships in instance view (part... (diff) | |
| parent | prevent login and password reset for system accounts (diff) | |
| download | sharkey-ba5eec2129f1976c817925a1ec8ef10e23749d84.tar.gz sharkey-ba5eec2129f1976c817925a1ec8ef10e23749d84.tar.bz2 sharkey-ba5eec2129f1976c817925a1ec8ef10e23749d84.zip | |
merge: Prevent deletion or suspension of system accounts (resolves #625) (!666)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/666
Closes #625
Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/server/api/SigninApiService.ts')
| -rw-r--r-- | packages/backend/src/server/api/SigninApiService.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/SigninApiService.ts b/packages/backend/src/server/api/SigninApiService.ts index 6fbcacbc11..d212e3de79 100644 --- a/packages/backend/src/server/api/SigninApiService.ts +++ b/packages/backend/src/server/api/SigninApiService.ts @@ -26,6 +26,7 @@ import { RateLimiterService } from './RateLimiterService.js'; import { SigninService } from './SigninService.js'; import type { AuthenticationResponseJSON } from '@simplewebauthn/types'; import type { FastifyReply, FastifyRequest } from 'fastify'; +import { isSystemAccount } from '@/misc/is-system-account.js'; @Injectable() export class SigninApiService { @@ -125,6 +126,12 @@ export class SigninApiService { }); } + if (isSystemAccount(user)) { + return error(403, { + id: 's8dhsj9s-a93j-493j-ja9k-kas9sj20aml2', + }); + } + const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); if (!user.approved && instance.approvalRequiredForSignup) { |