Skip to content

Commit 2730793

Browse files
authored
Merge pull request #116 from thefrontside/email-is-the-new-mail
use `email` in the id token data, not `mail`
2 parents 842de6f + d6e5f3a commit 2730793

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.changes/email-typo.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@simulacrum/auth0-simulator": patch
3+
---
4+
fix malformed token that had `mail` field, not `email` field

package-lock.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/auth0/src/handlers/auth0-handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const createAuth0Handlers = (options: Options): Record<Routes, HttpHandle
181181
iss: url,
182182
exp: expiresAt(),
183183
iat: Date.now(),
184-
mail: username,
184+
email: username,
185185
aud: clientId,
186186
sub: user.id,
187187
nonce,

packages/auth0/test/auth0.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ describe('Auth0 simulator', () => {
289289
it('should return an iss field with a forward slash', function* () {
290290
expect(token.payload.iss).toBe('https://localhost:4400/');
291291
});
292+
293+
it('token sould contain a valid email', function* () {
294+
expect(token.payload.email).toBe(person.data.email);
295+
});
292296
});
293297

294298

0 commit comments

Comments
 (0)