diff options
| author | Hazel K <acomputerdog@gmail.com> | 2024-10-07 14:58:39 -0400 |
|---|---|---|
| committer | Hazel K <acomputerdog@gmail.com> | 2024-10-07 14:58:39 -0400 |
| commit | cd9bce307218c864608a0e60cb5f74262bf10d0c (patch) | |
| tree | 67a57666a604834637160ffcd3c39217dac91803 /packages/backend/src/server/api/SigninApiService.ts | |
| parent | Merge branch 'develop' into hazelnoot/625-protect-system-accounts (diff) | |
| download | sharkey-cd9bce307218c864608a0e60cb5f74262bf10d0c.tar.gz sharkey-cd9bce307218c864608a0e60cb5f74262bf10d0c.tar.bz2 sharkey-cd9bce307218c864608a0e60cb5f74262bf10d0c.zip | |
prevent login and password reset for system accounts
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) { |