feat update
This commit is contained in:
@@ -63,7 +63,9 @@ describe("actual administrator session boundary", () => {
|
||||
(await import("./server")).getAuth();
|
||||
const options = mocks.auth.mock.calls.at(-1)![0];
|
||||
expect(options.emailAndPassword.requireEmailVerification).toBe(true);
|
||||
expect(options.emailVerification).toMatchObject({ sendOnSignUp: false });
|
||||
expect(options.emailVerification).toMatchObject({
|
||||
sendOnSignUp: false, autoSignInAfterVerification: true,
|
||||
});
|
||||
expect(options.user.changeEmail.enabled).toBe(true);
|
||||
const otp = options.plugins.find((plugin: { id?: string }) => plugin.id === "email-otp");
|
||||
expect(otp.options).toMatchObject({ sendVerificationOnSignUp: true, storeOTP: "hashed" });
|
||||
|
||||
@@ -72,6 +72,7 @@ function createAuth() {
|
||||
},
|
||||
emailVerification: {
|
||||
sendOnSignUp: false,
|
||||
autoSignInAfterVerification: true,
|
||||
sendVerificationEmail: async ({ user, url }) => {
|
||||
await sendAuthEmail(user.email, "ยืนยันอีเมล Buzz Guide", `เปิดลิงก์นี้เพื่อยืนยันอีเมล: ${url}\n\nลิงก์นี้หมดอายุใน 1 ชั่วโมง`);
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ export async function notifyPaidTicketDiscord(ticketId: string, amountBaht: numb
|
||||
embeds: [{
|
||||
title: "มี Ticket คอมมิชชันใหม่ที่ชำระเงินแล้ว",
|
||||
url: new URL(`/admin/commission/${ticketId}`, process.env.BETTER_AUTH_URL ?? siteUrl).toString(),
|
||||
description: `Ticket #${ticketId.slice(0, 8)} · ฿${amountBaht}`,
|
||||
description: `Ticket #${ticketId.slice(0, 8)} - ฿${amountBaht}`,
|
||||
color: 0x57f287,
|
||||
timestamp: new Date().toISOString(),
|
||||
}],
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function sendCommissionMessagePush(message: {
|
||||
for (let offset = 0; offset < subscriptions.length; offset += 10) {
|
||||
await Promise.all(subscriptions.slice(offset, offset + 10).map(async ({ subscription }) => {
|
||||
const payload = JSON.stringify({
|
||||
id: message.id, title: `${message.authorName} · ${message.ticketTitle}`,
|
||||
id: message.id, title: `${message.authorName} - ${message.ticketTitle}`,
|
||||
body: message.text?.slice(0, 300) || "ส่งรูปภาพ",
|
||||
url: `/${subscription.scope === "admin" ? "admin/commission" : "commission/tickets"}/${message.ticketId}`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user