import { ManagementClient } from "../../../clients" ; import { RegisterVerificationParameters as Parameters , RegisterVerificationRequest as Request } from "../../../common" ; import { Verification } from "../../../verification" ; import { handler } from "../../_" ; import schema = require ( "../../../common/events/register/verify/index.json" ) ; param event return export const post = handler < Parameters , Request > ( schema , async ( { pathParameters : { code } } ) => { try { const verification = new Verification ( ) ; const mgmt = new ManagementClient ( ) ; const { subject } = await verification . claim ( "register" , code ) ; await mgmt . verifyUser ( subject ) ; } catch ( err ) { err . statusCode = 403 ; throw err ; } } ) ;