prevent login and password reset for system accounts
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user