Skip to content

Commit 2cdaf80

Browse files
committed
Encode usernames to avoid invalid email characters
1 parent 2f8382c commit 2cdaf80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/token/callback.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const onRequest: PagesFunction<IPocketLetterEnv> = async ({
3232
});
3333

3434
const {username, access_token} = await response.json();
35-
const alias = username.toLowerCase();
35+
const alias = encodeURIComponent(username.toLowerCase());
3636
await env.ALIASES.put(alias, access_token);
3737
const address = `${alias}@${MAILING_DOMAIN}`;
3838

0 commit comments

Comments
 (0)