Tests, UX improvements.
This commit is contained in:
parent
4e6f5d36b8
commit
0ae18f495e
63 changed files with 1384 additions and 2330 deletions
|
|
@ -52,19 +52,23 @@ export default defineEventHandler(async (event) => {
|
|||
// Token goes in the fragment — never sent to server, never logged
|
||||
const magicLink = `${baseUrl}/verify#${token}`;
|
||||
|
||||
const emailSubject = "Your Ghost Guild login link";
|
||||
const emailBody = `Hi,\n\nSign in to Ghost Guild:\n${magicLink}\n\nThis link expires in 15 minutes. If you didn't request it, ignore this email.`;
|
||||
|
||||
try {
|
||||
await resend.emails.send({
|
||||
from: "Ghost Guild <ghostguild@babyghosts.org>",
|
||||
to: email,
|
||||
subject: "Your Ghost Guild login link",
|
||||
text: `Hi,
|
||||
|
||||
Sign in to Ghost Guild:
|
||||
${magicLink}
|
||||
|
||||
This link expires in 15 minutes. If you didn't request it, ignore this email.`,
|
||||
subject: emailSubject,
|
||||
text: emailBody,
|
||||
});
|
||||
|
||||
logActivity(member._id, 'email_sent', {
|
||||
emailType: 'magic_link',
|
||||
subject: emailSubject,
|
||||
body: emailBody
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: GENERIC_MESSAGE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue