mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
16 lines
374 B
TypeScript
16 lines
374 B
TypeScript
import { load } from "cheerio";
|
|
|
|
import { captureEmailHTML } from "./mailpit/mailpit";
|
|
|
|
/**
|
|
* Get the 6-digit code from the email
|
|
* @param email The email address to get the code for
|
|
* @returns 6-digit code
|
|
*/
|
|
export const getCode = async (email: string) => {
|
|
const html = await captureEmailHTML(email);
|
|
|
|
const $ = load(html);
|
|
|
|
return $("#code").text().trim();
|
|
};
|