diff options
| author | Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> | 2020-05-09 08:20:22 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-09 08:20:22 +0900 |
| commit | 234294d564f49b1926ebf4a74d418e419ea4da71 (patch) | |
| tree | e69b661b9e2e79792104e431255622bc9a0b53d1 /src/client/components | |
| parent | brotli圧縮の無効化など Resolve #6325 (#6326) (diff) | |
| download | sharkey-234294d564f49b1926ebf4a74d418e419ea4da71.tar.gz sharkey-234294d564f49b1926ebf4a74d418e419ea4da71.tar.bz2 sharkey-234294d564f49b1926ebf4a74d418e419ea4da71.zip | |
WebAuthnでログインできないのを修正 (#6327)
Resolve #6319
Diffstat (limited to 'src/client/components')
| -rwxr-xr-x | src/client/components/signin.vue | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/client/components/signin.vue b/src/client/components/signin.vue index b84b89a5c7..dc73ad8a0f 100755 --- a/src/client/components/signin.vue +++ b/src/client/components/signin.vue @@ -51,7 +51,7 @@ import MkButton from './ui/button.vue'; import MkInput from './ui/input.vue'; import i18n from '../i18n'; import { apiUrl, host } from '../config'; -import { hexifyAB } from '../scripts/2fa'; +import { byteify, hexify } from '../scripts/2fa'; export default Vue.extend({ i18n, @@ -121,14 +121,9 @@ export default Vue.extend({ this.queryingKey = true; return navigator.credentials.get({ publicKey: { - challenge: Buffer.from( - this.challengeData.challenge - .replace(/\-/g, '+') - .replace(/_/g, '/'), - 'base64' - ), + challenge: byteify(this.challengeData.challenge, 'base64'), allowCredentials: this.challengeData.securityKeys.map(key => ({ - id: Buffer.from(key.id, 'hex'), + id: byteify(key.id, 'hex'), type: 'public-key', transports: ['usb', 'nfc', 'ble', 'internal'] })), @@ -143,9 +138,9 @@ export default Vue.extend({ return this.$root.api('signin', { username: this.username, password: this.password, - signature: hexifyAB(credential.response.signature), - authenticatorData: hexifyAB(credential.response.authenticatorData), - clientDataJSON: hexifyAB(credential.response.clientDataJSON), + signature: hexify(credential.response.signature), + authenticatorData: hexify(credential.response.authenticatorData), + clientDataJSON: hexify(credential.response.clientDataJSON), credentialId: credential.id, challengeId: this.challengeData.challengeId }); |