mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-07-01 12:21:57 +08:00
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:
@@ -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[]> => {
|
||||
|
||||
Reference in New Issue
Block a user