Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
Update mail.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
XSPGMike authored Mar 29, 2023
1 parent 476d742 commit 9e3b4e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ const getLatestEmail = async (sid_token) => {
}

const getEmailContent = async (sid_token, id) => {
const response = await fetch(`${BASEURL}?f=fetch_email&email_id=${id}&sid_token=${sid_token}`)
const content = await response.json();
return (/\b(?<!#)\d{6}\b/g.exec(content.mail_body))?.[0]
const response = await fetch(`${BASEURL}?f=fetch_email&email_id=${id}&sid_token=${sid_token}`)
const content = await response.json();
return (/\b(?<!#)\d{6}\b/g.exec(content.mail_body))?.[0]
}

const getPoeOTPCode = async (sid_token) => {
const emailData = await getLatestEmail(sid_token)
return (
await getEmailContent(sid_token, emailData.mail_id)
await getEmailContent(sid_token, emailData.mail_id)
)
}

Expand Down

0 comments on commit 9e3b4e5

Please sign in to comment.