@@ -27,6 +27,8 @@ import (
2727 "github.com/supertokens/supertokens-golang/recipe/emailpassword"
2828 "github.com/supertokens/supertokens-golang/recipe/emailpassword/epmodels"
2929 "github.com/supertokens/supertokens-golang/recipe/emailverification"
30+ "github.com/supertokens/supertokens-golang/recipe/emailverification/emaildelivery/smtpService"
31+ "github.com/supertokens/supertokens-golang/recipe/emailverification/evmodels"
3032 "github.com/supertokens/supertokens-golang/recipe/session"
3133 "github.com/supertokens/supertokens-golang/recipe/thirdparty/tpmodels"
3234 "github.com/supertokens/supertokens-golang/recipe/thirdpartyemailpassword/tpepmodels"
@@ -514,7 +516,7 @@ func TestDefaultBackwardCompatibilityEmailVerifyForEmailPasswordUser(t *testing.
514516 unittesting .StartUpST ("localhost" , "8080" )
515517 defer AfterEach ()
516518
517- testServer := supertokensInitForTest (t , session .Init (nil ), Init (nil ))
519+ testServer := supertokensInitForTest (t , emailverification . Init (evmodels. TypeInput { Mode : evmodels . ModeOptional }), session .Init (nil ), Init (nil ))
518520 defer testServer .Close ()
519521
520522 resp ,
err := unittesting .
SignupRequest (
"[email protected] " ,
"1234abcd" ,
testServer .
URL )
@@ -540,7 +542,7 @@ func TestDefaultBackwardCompatibilityEmailVerifyForThirdpartyUser(t *testing.T)
540542 customProviderForEmailVerification ,
541543 },
542544 }
543- testServer := supertokensInitForTest (t , session .Init (nil ), Init (tpepConfig ))
545+ testServer := supertokensInitForTest (t , emailverification . Init (evmodels. TypeInput { Mode : evmodels . ModeOptional }), session .Init (nil ), Init (tpepConfig ))
544546 defer testServer .Close ()
545547
546548 signinupPostData := PostDataForCustomProvider {
@@ -671,6 +673,12 @@ func TestCustomOverrideEmailVerifyForEmailPasswordUser(t *testing.T) {
671673 emailVerifyLink := ""
672674
673675 tpepConfig := & tpepmodels.TypeInput {
676+ Providers : []tpmodels.TypeProvider {
677+ customProviderForEmailVerification ,
678+ },
679+ }
680+ testServer := supertokensInitForTest (t , emailverification .Init (evmodels.TypeInput {
681+ Mode : evmodels .ModeOptional ,
674682 EmailDelivery : & emaildelivery.TypeInput {
675683 Override : func (originalImplementation emaildelivery.EmailDeliveryInterface ) emaildelivery.EmailDeliveryInterface {
676684 * originalImplementation .SendEmail = func (input emaildelivery.EmailType , userContext supertokens.UserContext ) error {
@@ -684,8 +692,7 @@ func TestCustomOverrideEmailVerifyForEmailPasswordUser(t *testing.T) {
684692 return originalImplementation
685693 },
686694 },
687- }
688- testServer := supertokensInitForTest (t , session .Init (nil ), Init (tpepConfig ))
695+ }), session .Init (nil ), Init (tpepConfig ))
689696 defer testServer .Close ()
690697
691698 resp ,
err := unittesting .
SignupRequest (
"[email protected] " ,
"1234abcd" ,
testServer .
URL )
@@ -716,6 +723,12 @@ func TestCustomOverrideEmailVerifyForThirdpartyUser(t *testing.T) {
716723 emailVerifyLink := ""
717724
718725 tpepConfig := & tpepmodels.TypeInput {
726+ Providers : []tpmodels.TypeProvider {
727+ customProviderForEmailVerification ,
728+ },
729+ }
730+ testServer := supertokensInitForTest (t , emailverification .Init (evmodels.TypeInput {
731+ Mode : evmodels .ModeOptional ,
719732 EmailDelivery : & emaildelivery.TypeInput {
720733 Override : func (originalImplementation emaildelivery.EmailDeliveryInterface ) emaildelivery.EmailDeliveryInterface {
721734 * originalImplementation .SendEmail = func (input emaildelivery.EmailType , userContext supertokens.UserContext ) error {
@@ -729,9 +742,7 @@ func TestCustomOverrideEmailVerifyForThirdpartyUser(t *testing.T) {
729742 return originalImplementation
730743 },
731744 },
732- Providers : []tpmodels.TypeProvider {customProviderForEmailVerification },
733- }
734- testServer := supertokensInitForTest (t , session .Init (nil ), Init (tpepConfig ))
745+ }), session .Init (nil ), Init (tpepConfig ))
735746 defer testServer .Close ()
736747
737748 signinupPostData := PostDataForCustomProvider {
@@ -772,7 +783,7 @@ func TestSMTPOverrideEmailVerifyForEmailPasswordUser(t *testing.T) {
772783 email := ""
773784 emailVerifyLink := ""
774785
775- smtpService := MakeSMTPService (emaildelivery.SMTPServiceConfig {
786+ smtpService := smtpService . MakeSMTPService (emaildelivery.SMTPServiceConfig {
776787 Settings : emaildelivery.SMTPSettings {
777788 Host : "" ,
778789 From : emaildelivery.SMTPFrom {
@@ -800,12 +811,13 @@ func TestSMTPOverrideEmailVerifyForEmailPasswordUser(t *testing.T) {
800811 return originalImplementation
801812 },
802813 })
803- tpepConfig := & tpepmodels.TypeInput {
814+ tpepConfig := & tpepmodels.TypeInput {}
815+ testServer := supertokensInitForTest (t , emailverification .Init (evmodels.TypeInput {
816+ Mode : evmodels .ModeOptional ,
804817 EmailDelivery : & emaildelivery.TypeInput {
805818 Service : smtpService ,
806819 },
807- }
808- testServer := supertokensInitForTest (t , session .Init (nil ), Init (tpepConfig ))
820+ }), session .Init (nil ), Init (tpepConfig ))
809821 defer testServer .Close ()
810822
811823 resp ,
err := unittesting .
SignupRequest (
"[email protected] " ,
"1234abcd" ,
testServer .
URL )
@@ -837,7 +849,7 @@ func TestSMTPOverrideEmailVerifyForThirdpartyUser(t *testing.T) {
837849 email := ""
838850 emailVerifyLink := ""
839851
840- smtpService := MakeSMTPService (emaildelivery.SMTPServiceConfig {
852+ smtpService := smtpService . MakeSMTPService (emaildelivery.SMTPServiceConfig {
841853 Settings : emaildelivery.SMTPSettings {
842854 Host : "" ,
843855 From : emaildelivery.SMTPFrom {
@@ -866,12 +878,14 @@ func TestSMTPOverrideEmailVerifyForThirdpartyUser(t *testing.T) {
866878 },
867879 })
868880 tpepConfig := & tpepmodels.TypeInput {
881+ Providers : []tpmodels.TypeProvider {customProviderForEmailVerification },
882+ }
883+ testServer := supertokensInitForTest (t , emailverification .Init (evmodels.TypeInput {
884+ Mode : evmodels .ModeOptional ,
869885 EmailDelivery : & emaildelivery.TypeInput {
870886 Service : smtpService ,
871887 },
872- Providers : []tpmodels.TypeProvider {customProviderForEmailVerification },
873- }
874- testServer := supertokensInitForTest (t , session .Init (nil ), Init (tpepConfig ))
888+ }), session .Init (nil ), Init (tpepConfig ))
875889 defer testServer .Close ()
876890
877891 signinupPostData := PostDataForCustomProvider {
0 commit comments