diff --git a/background/contribution-oauth.js b/background/contribution-oauth.js index 7dc5608..e95cbc3 100644 --- a/background/contribution-oauth.js +++ b/background/contribution-oauth.js @@ -599,6 +599,7 @@ body: { nickname: buildNickname(currentState, options.nickname), qq: buildContributionQq(currentState, options.qq), + email: normalizeString(currentState.email), source: 'cpa', channel: 'codex-extension', }, diff --git a/tests/background-contribution-mode.test.js b/tests/background-contribution-mode.test.js index b3d6901..67202c7 100644 --- a/tests/background-contribution-mode.test.js +++ b/tests/background-contribution-mode.test.js @@ -423,6 +423,7 @@ test('contribution oauth manager starts session, opens auth url, submits callbac assert.match(fetchCalls[0].url, /\/start$/); assert.match(String(fetchCalls[0].options.body || ''), /"nickname":""/); assert.match(String(fetchCalls[0].options.body || ''), /"qq":""/); + assert.match(String(fetchCalls[0].options.body || ''), /"email":"user@example\.com"/); assert.match(fetchCalls[1].url, /\/status\?/); const callbackState = await manager.handleCapturedCallback(