@@ -17,7 +17,7 @@ const responses = {
17
17
18
18
describe ( 'AuthenticationProviders' , function ( ) {
19
19
[
20
- 'apple-signin ' ,
20
+ 'apple' ,
21
21
'facebook' ,
22
22
'facebookaccountkit' ,
23
23
'github' ,
@@ -51,7 +51,7 @@ describe('AuthenticationProviders', function() {
51
51
} ) ;
52
52
53
53
it ( `should provide the right responses for adapter ${ providerName } ` , async ( ) => {
54
- if ( providerName === 'twitter' || providerName === 'apple-signin ' ) {
54
+ if ( providerName === 'twitter' || providerName === 'apple' ) {
55
55
return ;
56
56
}
57
57
spyOn ( require ( '../lib/Adapters/Auth/httpsRequest' ) , 'get' ) . and . callFake (
@@ -1087,22 +1087,22 @@ describe('oauth2 auth adapter', () => {
1087
1087
} ) ;
1088
1088
1089
1089
describe ( 'apple signin auth adapter' , ( ) => {
1090
- const apple = require ( '../lib/Adapters/Auth/apple-signin ' ) ;
1090
+ const apple = require ( '../lib/Adapters/Auth/apple' ) ;
1091
1091
const jwt = require ( 'jsonwebtoken' ) ;
1092
1092
1093
1093
it ( 'should throw error with missing id_token' , async ( ) => {
1094
1094
try {
1095
1095
await apple . validateAuthData ( { } , { client_id : 'secret' } ) ;
1096
1096
fail ( ) ;
1097
1097
} catch ( e ) {
1098
- expect ( e . message ) . toBe ( 'id_token is invalid for this user.' ) ;
1098
+ expect ( e . message ) . toBe ( 'id token is invalid for this user.' ) ;
1099
1099
}
1100
1100
} ) ;
1101
1101
1102
1102
it ( 'should not verify invalid id_token' , async ( ) => {
1103
1103
try {
1104
1104
await apple . validateAuthData (
1105
- { id_token : 'the_token' } ,
1105
+ { id : 'the_token' } ,
1106
1106
{ client_id : 'secret' }
1107
1107
) ;
1108
1108
fail ( ) ;
@@ -1120,7 +1120,7 @@ describe('apple signin auth adapter', () => {
1120
1120
spyOn ( jwt , 'verify' ) . and . callFake ( ( ) => fakeClaim ) ;
1121
1121
1122
1122
const result = await apple . validateAuthData (
1123
- { id_token : 'the_token' } ,
1123
+ { id : 'the_token' } ,
1124
1124
{ client_id : 'secret' }
1125
1125
) ;
1126
1126
expect ( result ) . toEqual ( fakeClaim ) ;
@@ -1134,13 +1134,13 @@ describe('apple signin auth adapter', () => {
1134
1134
1135
1135
try {
1136
1136
await apple . validateAuthData (
1137
- { id_token : 'the_token' } ,
1137
+ { id : 'the_token' } ,
1138
1138
{ client_id : 'secret' }
1139
1139
) ;
1140
1140
fail ( ) ;
1141
1141
} catch ( e ) {
1142
1142
expect ( e . message ) . toBe (
1143
- 'id_token not issued by correct OpenID provider - expected: https://appleid.apple.com | from: https://not.apple.com'
1143
+ 'id token not issued by correct OpenID provider - expected: https://appleid.apple.com | from: https://not.apple.com'
1144
1144
) ;
1145
1145
}
1146
1146
} ) ;
@@ -1154,7 +1154,7 @@ describe('apple signin auth adapter', () => {
1154
1154
1155
1155
try {
1156
1156
await apple . validateAuthData (
1157
- { id_token : 'the_token' } ,
1157
+ { id : 'the_token' } ,
1158
1158
{ client_id : 'secret' }
1159
1159
) ;
1160
1160
fail ( ) ;
0 commit comments