feat: вход по лицу целиком — заведение ключа, вход, отзыв на служебной странице
This commit is contained in:
@@ -39,6 +39,26 @@ export function createAdminRouter({ history, getStatus, auth = null }) {
|
||||
});
|
||||
});
|
||||
|
||||
/** Ключи входа по лицу: какие заведены и на чьих устройствах. */
|
||||
router.get('/passkeys', (request, response) => {
|
||||
if (!auth) {
|
||||
response.json({ available: false, keys: [] });
|
||||
return;
|
||||
}
|
||||
response.json({ available: true, keys: auth.allPasskeys() });
|
||||
});
|
||||
|
||||
/** Отзыв ключа: потеряли планшет или человек уволился. */
|
||||
router.post('/passkeys/revoke', (request, response) => {
|
||||
const credentialId = String(request.body?.credentialId ?? '').trim();
|
||||
if (!auth || !credentialId) {
|
||||
response.status(400).json({ error: 'нужен ключ, который отзываем' });
|
||||
return;
|
||||
}
|
||||
auth.revokePasskey(credentialId);
|
||||
response.json({ ok: true });
|
||||
});
|
||||
|
||||
/** Журнал попыток входа: по нему разбирают, кого пустили и кого остановили. */
|
||||
router.get('/logins', (request, response) => {
|
||||
if (!auth) {
|
||||
|
||||
Reference in New Issue
Block a user