Skip to content

Commit f92931d

Browse files
committed
Update spec
1 parent 1290fd9 commit f92931d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

spec/AuthenticationAdapters.spec.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ describe('apple signin auth adapter', () => {
11041104
it('should not verify invalid id_token', async () => {
11051105
try {
11061106
await apple.validateAuthData(
1107-
{ id: 'the_token' },
1107+
{ id: 'the_user_id', token: 'the_token' },
11081108
{ client_id: 'secret' }
11091109
);
11101110
fail();
@@ -1118,11 +1118,12 @@ describe('apple signin auth adapter', () => {
11181118
iss: 'https://appleid.apple.com',
11191119
aud: 'secret',
11201120
exp: Date.now(),
1121+
sub: 'the_user_id',
11211122
};
11221123
spyOn(jwt, 'verify').and.callFake(() => fakeClaim);
11231124

11241125
const result = await apple.validateAuthData(
1125-
{ id: 'the_token' },
1126+
{ id: 'the_user_id', token: 'the_token' },
11261127
{ client_id: 'secret' }
11271128
);
11281129
expect(result).toEqual(fakeClaim);
@@ -1131,12 +1132,13 @@ describe('apple signin auth adapter', () => {
11311132
it('should throw error with with invalid jwt issuer', async () => {
11321133
const fakeClaim = {
11331134
iss: 'https://not.apple.com',
1135+
sub: 'the_user_id',
11341136
};
11351137
spyOn(jwt, 'verify').and.callFake(() => fakeClaim);
11361138

11371139
try {
11381140
await apple.validateAuthData(
1139-
{ id: 'the_token' },
1141+
{ id: 'the_user_id', token: 'the_token' },
11401142
{ client_id: 'secret' }
11411143
);
11421144
fail();
@@ -1151,12 +1153,13 @@ describe('apple signin auth adapter', () => {
11511153
const fakeClaim = {
11521154
iss: 'https://appleid.apple.com',
11531155
aud: 'invalid_client_id',
1156+
sub: 'the_user_id',
11541157
};
11551158
spyOn(jwt, 'verify').and.callFake(() => fakeClaim);
11561159

11571160
try {
11581161
await apple.validateAuthData(
1159-
{ id: 'the_token' },
1162+
{ id: 'the_user_id', token: 'the_token' },
11601163
{ client_id: 'secret' }
11611164
);
11621165
fail();

0 commit comments

Comments
 (0)