prevent login and password reset for system accounts
This commit is contained in:
parent
126a2fcf15
commit
cd9bce3072
8 changed files with 45 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue