Skip to content

Commit 82d8ac6

Browse files
committed
fixes issue
1 parent 634da75 commit 82d8ac6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/auth-react-server/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,22 @@ func callSTInit(passwordlessConfig *plessmodels.TypeInput) {
9292
return saveCode(input.PasswordlessLogin.PhoneNumber, input.PasswordlessLogin.UserInputCode, input.PasswordlessLogin.UrlWithLinkCode, input.PasswordlessLogin.CodeLifetime, input.PasswordlessLogin.PreAuthSessionId, userContext)
9393
}
9494

95+
sendPasswordlessLoginEmail := func(input emaildelivery.EmailType, userContext supertokens.UserContext) error {
96+
return saveCode(input.PasswordlessLogin.Email, input.PasswordlessLogin.UserInputCode, input.PasswordlessLogin.UrlWithLinkCode, input.PasswordlessLogin.CodeLifetime, input.PasswordlessLogin.PreAuthSessionId, userContext)
97+
}
98+
9599
if passwordlessConfig == nil {
96100
passwordlessConfig = &plessmodels.TypeInput{
97101
SmsDelivery: &smsdelivery.TypeInput{
98102
Service: &smsdelivery.SmsDeliveryInterface{
99103
SendSms: &sendPasswordlessLoginSms,
100104
},
101105
},
106+
EmailDelivery: &emaildelivery.TypeInput{
107+
Service: &emaildelivery.EmailDeliveryInterface{
108+
SendEmail: &sendPasswordlessLoginEmail,
109+
},
110+
},
102111
ContactMethodEmailOrPhone: plessmodels.ContactMethodEmailOrPhoneConfig{
103112
Enabled: true,
104113
},
@@ -414,6 +423,7 @@ func callSTInit(passwordlessConfig *plessmodels.TypeInput) {
414423
rw.Write(bytes)
415424
} else if r.URL.Path == "/beforeeach" && r.Method == "POST" {
416425
deviceStore = map[string]CustomDevice{}
426+
callSTInit(nil)
417427
rw.WriteHeader(200)
418428
rw.Header().Add("content-type", "application/json")
419429
bytes, _ := json.Marshal(map[string]interface{}{})

0 commit comments

Comments
 (0)