mailbox.onAuthUpdated
emailkit refreshed a mailbox's tokens — overwrite what you stored.
Fires when emailkit refreshes a connected mailbox’s tokens. Overwrite the stored auth — the old one is dead, and the next operation on this mailbox needs the new one.
hooks: {
mailbox: {
onAuthUpdated: async ({ mailbox, auth }) => {
if (!mailbox?.email) return;
await prisma.connectedMailbox.updateMany({
where: { email: mailbox.email },
data: { auth: encrypt(auth) },
});
},
},
},
Payload
PropType
emailDriverstring
Type
stringmailboxMailboxIdentity
Type
MailboxIdentityauthunknown
Type
unknowncontext?unknown
Type
unknownraw?unknown
Type
unknown