use for-of statements to replace for and for-in

This commit is contained in:
MaysWind
2025-09-09 23:48:42 +08:00
parent c75a902d84
commit 34c5a1750e
50 changed files with 368 additions and 460 deletions
+3 -3
View File
@@ -180,7 +180,7 @@ export function verifyWebAuthnCredential(userInfo: UserBasicInfo, credentialId:
}) as PublicKeyCredentialRequestOptions;
if (publicKeyCredentialRequestOptions.allowCredentials && publicKeyCredentialRequestOptions.allowCredentials.length > 0) {
publicKeyCredentialRequestOptions.allowCredentials[0].id = stringToArrayBuffer(base64decode(credentialId));
publicKeyCredentialRequestOptions.allowCredentials[0]!.id = stringToArrayBuffer(base64decode(credentialId));
}
logger.debug('webauthn get options', publicKeyCredentialRequestOptions);
@@ -199,8 +199,8 @@ export function verifyWebAuthnCredential(userInfo: UserBasicInfo, credentialId:
userIdParts && userIdParts.length === 2 && userIdParts[0] === userInfo.username) {
const ret: WebAuthnVerifyResponse = {
id: base64encode(rawCredential.rawId),
userName: userIdParts[0],
userSecret: userIdParts[1],
userName: userIdParts[0] as string,
userSecret: userIdParts[1] as string,
clientData: clientData,
rawCredential: rawCredential
};