From 778ac79c442373a6491f9c38318a7be4cd45016a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Wed, 6 May 2020 18:59:58 +0900 Subject: [PATCH] Fix using Buffer on window scope (#6324) * Update 2fa.vue * Import 'core-js/es/typed-array/from' * Bye polyfill --- src/client/pages/my-settings/2fa.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/pages/my-settings/2fa.vue b/src/client/pages/my-settings/2fa.vue index 8432bdb32..1d1e111da 100644 --- a/src/client/pages/my-settings/2fa.vue +++ b/src/client/pages/my-settings/2fa.vue @@ -208,11 +208,11 @@ export default Vue.extend({ challengeId: registration.challengeId, stage: 0, publicKeyOptions: { - challenge: Buffer.from( - registration.challenge - .replace(/\-/g, "+") - .replace(/_/g, "/"), - 'base64' + challenge: Uint8Array.from( + atob(registration.challenge + .replace(/\-/g, '+') + .replace(/_/g, '/')), + x => x.charCodeAt(0), ), rp: { id: hostname, @@ -223,7 +223,7 @@ export default Vue.extend({ name: this.$store.state.i.username, displayName: this.$store.state.i.name, }, - pubKeyCredParams: [{alg: -7, type: 'public-key'}], + pubKeyCredParams: [{ alg: -7, type: 'public-key' }], timeout: 60000, attestation: 'direct' },