diff --git a/packages/pds/src/api/com/atproto/server/util.ts b/packages/pds/src/api/com/atproto/server/util.ts index 3f5d1f2dd97..135b51cb0e1 100644 --- a/packages/pds/src/api/com/atproto/server/util.ts +++ b/packages/pds/src/api/com/atproto/server/util.ts @@ -24,8 +24,7 @@ export const genInvCodes = (cfg: ServerConfig, count: number): string[] => { // Random token formatted XXXXX-XXXXX where digits are in base32 export const getEmailToken = () => { - const token = crypto.randomStr(8, 'base32').slice(0, 10).toUpperCase() - return token.slice(0, 5) + '-' + token.slice(5, 10) + return normalizeEmailToken(crypto.randomStr(8, 'base32')) } // Transforms a badly-formed email token to XXXXX-XXXXX