-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide proper error for updating to an email that's already in use (#…
…1770) provide proper error for updating to an email already in use
- Loading branch information
Showing
4 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,19 @@ describe('email confirmation', () => { | |
) | ||
}) | ||
|
||
it('fails email update with in-use email', async () => { | ||
const attempt = agent.api.com.atproto.server.updateEmail( | ||
{ | ||
email: '[email protected]', | ||
token: updateToken, | ||
}, | ||
{ headers: sc.getHeaders(alice.did), encoding: 'application/json' }, | ||
) | ||
await expect(attempt).rejects.toThrow( | ||
'This email address is already in use, please use a different email.', | ||
) | ||
}) | ||
|
||
it('updates email', async () => { | ||
await agent.api.com.atproto.server.updateEmail( | ||
{ | ||
|