Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
26 lines
809 B
Plaintext
26 lines
809 B
Plaintext
import { status as httpStatus } from 'http-status';
|
|
import { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js';
|
|
import { headersWithCors } from '../../utilities/headersWithCors.js';
|
|
import { verifyEmailOperation } from '../operations/verifyEmail.js';
|
|
export const verifyEmailHandler = async (req)=>{
|
|
const { id, collection } = getRequestCollectionWithID(req, {
|
|
disableSanitize: true
|
|
});
|
|
const { t } = req;
|
|
await verifyEmailOperation({
|
|
collection,
|
|
req,
|
|
token: id
|
|
});
|
|
return Response.json({
|
|
message: t('authentication:accountVerified')
|
|
}, {
|
|
headers: headersWithCors({
|
|
headers: new Headers(),
|
|
req
|
|
}),
|
|
status: httpStatus.OK
|
|
});
|
|
};
|
|
|
|
//# sourceMappingURL=verifyEmail.js.map |