fix and update
This commit is contained in:
@@ -17,7 +17,7 @@ export class FedcmService {
|
||||
) {}
|
||||
|
||||
async getAccounts(userId: string, sessionId: string) {
|
||||
await this.assertUnlockedSession(userId, sessionId);
|
||||
await this.assertExistingSession(userId, sessionId);
|
||||
|
||||
const user = await this.prisma.user.findFirst({
|
||||
where: { id: userId, deletedAt: null, status: 'ACTIVE', ...HUMAN_USER_WHERE }
|
||||
@@ -104,12 +104,17 @@ export class FedcmService {
|
||||
return this.settings.getBoolean('ONE_TAP_ENABLED', true);
|
||||
}
|
||||
|
||||
private async assertUnlockedSession(userId: string, sessionId: string) {
|
||||
private async assertExistingSession(userId: string, sessionId: string) {
|
||||
const state = await this.session.resolveSessionState(sessionId);
|
||||
if (!state || state.userId !== userId) {
|
||||
throw new UnauthorizedException('Сессия недействительна или истекла');
|
||||
}
|
||||
if (state.requiresPin) {
|
||||
}
|
||||
|
||||
private async assertUnlockedSession(userId: string, sessionId: string) {
|
||||
await this.assertExistingSession(userId, sessionId);
|
||||
const state = await this.session.resolveSessionState(sessionId);
|
||||
if (state?.requiresPin) {
|
||||
throw new UnauthorizedException('Требуется подтверждение PIN-кода');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user