({ }, type: 'cross-platform' | 'platform')
| 303 | @requireSudo |
| 304 | @param('type', Types.Range(['cross-platform', 'platform'])) |
| 305 | async postRegister({ }, type: 'cross-platform' | 'platform') { |
| 306 | const options = await generateRegistrationOptions({ |
| 307 | rpName: system.get('server.name'), |
| 308 | rpID: this.getAuthnHost(), |
| 309 | userID: isoUint8Array.fromUTF8String(this.user._id.toString()), |
| 310 | userDisplayName: this.user.uname, |
| 311 | userName: `${this.user.uname}(${this.user.mail})`, |
| 312 | attestationType: 'direct', |
| 313 | excludeCredentials: this.user._authenticators.map((c) => ({ |
| 314 | id: isoBase64URL.fromBuffer(new Uint8Array(c.credentialID.buffer)), |
| 315 | type: 'public-key', |
| 316 | })), |
| 317 | authenticatorSelection: { |
| 318 | residentKey: 'required', |
| 319 | userVerification: 'preferred', |
| 320 | authenticatorAttachment: type, |
| 321 | }, |
| 322 | }); |
| 323 | this.session.webauthnVerify = options.challenge; |
| 324 | this.response.body.authOptions = options; |
| 325 | } |
| 326 | |
| 327 | @requireSudo |
| 328 | @param('name', Types.String) |
nothing calls this directly
no test coverage detected