CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/api/v2/auth/redeem-verify-email.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import redeemVerifyEmail from "@cocalc/server/auth/redeem-verify-email";
7
import getParams from "lib/api/get-params";
8
9
export default async function redeemVerifyEmailAPICall(req, res) {
10
const { email_address, token } = getParams(req);
11
try {
12
await redeemVerifyEmail(email_address, token);
13
} catch (err) {
14
res.json({ error: `${err.message}` });
15
return;
16
}
17
res.json({});
18
return;
19
}
20
21