fix: lowercase configured address prefixes (#980)

* fix: normalize address casing for password login

Store new mailbox addresses in lowercase and migrate historical address data so mixed-case password logins can read inbox, sendbox, and settings consistently.

* fix: only lowercase configured address prefixes

Limit the #930 change to prefix normalization and document that existing mixed-case data must be migrated manually by users.
This commit is contained in:
jiaxin
2026-04-14 15:59:25 +08:00
committed by GitHub
parent 15e339282d
commit 3221f5ae30
3 changed files with 5 additions and 3 deletions

View File

@@ -728,13 +728,13 @@ export const commonGetUserRole = async (
export const getAddressPrefix = async (c: Context<HonoCustomType>): Promise<string | undefined> => {
const user = c.get("userPayload");
if (!user) {
return getStringValue(c.env.PREFIX);
return getStringValue(c.env.PREFIX).trim().toLowerCase();
}
const user_role = await commonGetUserRole(c, user.user_id);
if (typeof user_role?.prefix === "string") {
return user_role.prefix;
return user_role.prefix.trim().toLowerCase();
}
return getStringValue(c.env.PREFIX);
return getStringValue(c.env.PREFIX).trim().toLowerCase();
}
export const getAllowDomains = async (c: Context<HonoCustomType>): Promise<string[]> => {