@@ -749,53 +749,53 @@ describe("identity", () => {
749
749
750
750
expect ( identity . parseAuthEventContext ( decodedJwt , "project-id" , time ) ) . to . deep . equal ( context ) ;
751
751
} ) ;
752
-
753
- it ( "should parse a beforeSendSms event" , ( ) => {
754
- const time = now . getTime ( ) ;
755
- const decodedJwt = {
756
- iss : "https://securetoken.google.com/project_id" ,
757
- aud : "https://us-east1-project_id.cloudfunctions.net/function-1" ,
758
- iat : 1 ,
759
- exp : 60 * 60 + 1 ,
760
- event_id : "EVENT_ID" ,
761
- event_type : "beforeSendSms" ,
762
- user_agent : "USER_AGENT" ,
763
- ip_address : "1.2.3.4" ,
764
- locale : "en" ,
765
- recaptcha_score : TEST_RECAPTCHA_SCORE ,
766
- sms_type : "SIGN_IN_OR_SIGN_UP" ,
767
- phone_number : "+11234567890" ,
768
- } ;
769
- const context = {
770
- locale : "en" ,
771
- ipAddress : "1.2.3.4" ,
772
- userAgent : "USER_AGENT" ,
773
- eventId : "EVENT_ID" ,
774
- eventType : "providers/cloud.auth/eventTypes/user.beforeSendSms" ,
775
- emailType : undefined ,
776
- smsType : "SIGN_IN_OR_SIGN_UP" ,
777
- authType : "UNAUTHENTICATED" ,
778
- resource : {
779
- service : "identitytoolkit.googleapis.com" ,
780
- name : "projects/project-id" ,
781
- } ,
782
- timestamp : new Date ( 1000 ) . toUTCString ( ) ,
783
- additionalUserInfo : {
784
- isNewUser : false ,
785
- profile : undefined ,
786
- providerId : undefined ,
787
- username : undefined ,
788
- recaptchaScore : TEST_RECAPTCHA_SCORE ,
789
- email : undefined ,
790
- phoneNumber : "+11234567890" ,
791
- } ,
792
- credential : null ,
793
- params : { } ,
794
- } ;
795
-
796
- expect ( identity . parseAuthEventContext ( decodedJwt , "project-id" , time ) ) . to . deep . equal ( context ) ;
797
- } ) ;
798
- } ) ;
752
+
753
+ it ( "should parse a beforeSendSms event" , ( ) => {
754
+ const time = now . getTime ( ) ;
755
+ const decodedJwt = {
756
+ iss : "https://securetoken.google.com/project_id" ,
757
+ aud : "https://us-east1-project_id.cloudfunctions.net/function-1" ,
758
+ iat : 1 ,
759
+ exp : 60 * 60 + 1 ,
760
+ event_id : "EVENT_ID" ,
761
+ event_type : "beforeSendSms" ,
762
+ user_agent : "USER_AGENT" ,
763
+ ip_address : "1.2.3.4" ,
764
+ locale : "en" ,
765
+ recaptcha_score : TEST_RECAPTCHA_SCORE ,
766
+ sms_type : "SIGN_IN_OR_SIGN_UP" ,
767
+ phone_number : "+11234567890" ,
768
+ } ;
769
+ const context = {
770
+ locale : "en" ,
771
+ ipAddress : "1.2.3.4" ,
772
+ userAgent : "USER_AGENT" ,
773
+ eventId : "EVENT_ID" ,
774
+ eventType : "providers/cloud.auth/eventTypes/user.beforeSendSms" ,
775
+ emailType : undefined ,
776
+ smsType : "SIGN_IN_OR_SIGN_UP" ,
777
+ authType : "UNAUTHENTICATED" ,
778
+ resource : {
779
+ service : "identitytoolkit.googleapis.com" ,
780
+ name : "projects/project-id" ,
781
+ } ,
782
+ timestamp : new Date ( 1000 ) . toUTCString ( ) ,
783
+ additionalUserInfo : {
784
+ isNewUser : false ,
785
+ profile : undefined ,
786
+ providerId : undefined ,
787
+ username : undefined ,
788
+ recaptchaScore : TEST_RECAPTCHA_SCORE ,
789
+ email : undefined ,
790
+ phoneNumber : "+11234567890" ,
791
+ } ,
792
+ credential : null ,
793
+ params : { } ,
794
+ } ;
795
+
796
+ expect ( identity . parseAuthEventContext ( decodedJwt , "project-id" , time ) ) . to . deep . equal ( context ) ;
797
+ } ) ;
798
+ } ) ;
799
799
800
800
describe ( "validateAuthResponse" , ( ) => {
801
801
it ( "should not throw on undefined request" , ( ) => {
0 commit comments