MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / postRegister

Method postRegister

packages/hydrooj/src/handler/home.ts:305–325  ·  view source on GitHub ↗
({ }, type: 'cross-platform' | 'platform')

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

getAuthnHostMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected