migrate to "export default"
also, set no-use-before-define in linter
This commit is contained in:
+19
-18
@@ -1,8 +1,8 @@
|
||||
import assert from 'node:assert';
|
||||
import BoxError from './boxerror.js';
|
||||
import crypto from 'node:crypto';
|
||||
import * as dashboard from './dashboard.js';
|
||||
import * as database from './database.js';
|
||||
import dashboard from './dashboard.js';
|
||||
import database from './database.js';
|
||||
import debugModule from 'debug';
|
||||
import safe from 'safetydance';
|
||||
import {
|
||||
@@ -11,25 +11,10 @@ import {
|
||||
generateAuthenticationOptions as generateWebAuthnAuthenticationOptions,
|
||||
verifyAuthenticationResponse
|
||||
} from '@simplewebauthn/server';
|
||||
import * as _ from './underscore.js';
|
||||
import _ from './underscore.js';
|
||||
|
||||
const debug = debugModule('box:passkeys');
|
||||
|
||||
export {
|
||||
list,
|
||||
get,
|
||||
getByCredentialId,
|
||||
add,
|
||||
del,
|
||||
updateCounter,
|
||||
|
||||
generateRegistrationOptions,
|
||||
verifyRegistration,
|
||||
generateAuthenticationOptions,
|
||||
verifyAuthentication,
|
||||
|
||||
removePrivateFields
|
||||
};
|
||||
|
||||
const PASSKEY_FIELDS = [ 'id', 'userId', 'credentialId', 'publicKey', 'counter', 'transports', 'name', 'creationTime', 'lastUsedTime' ].join(',');
|
||||
|
||||
@@ -314,3 +299,19 @@ async function verifyAuthentication(user, response) {
|
||||
|
||||
return { verified: true, passkeyId: passkey.id };
|
||||
}
|
||||
|
||||
export default {
|
||||
list,
|
||||
get,
|
||||
getByCredentialId,
|
||||
add,
|
||||
del,
|
||||
updateCounter,
|
||||
|
||||
generateRegistrationOptions,
|
||||
verifyRegistration,
|
||||
generateAuthenticationOptions,
|
||||
verifyAuthentication,
|
||||
|
||||
removePrivateFields
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user