Skip to content

Commit 3bc9439

Browse files
committed
fix: tpless and login method api
1 parent eb760d7 commit 3bc9439

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

recipe/multitenancy/api/implementation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func MakeAPIImplementation() multitenancymodels.APIInterface {
2727

2828
mergedProviders := tpproviders.MergeProvidersFromCoreAndStatic(providerConfigsFromCore, providerInputsFromStatic)
2929

30-
var finalProviderList []multitenancymodels.TypeThirdPartyProvider
30+
var finalProviderList []multitenancymodels.TypeThirdPartyProvider = []multitenancymodels.TypeThirdPartyProvider{}
3131

3232
for _, providerInput := range mergedProviders {
3333
providerInstance, err := tpproviders.FindAndCreateProviderInstance(mergedProviders, providerInput.Config.ThirdPartyId, clientType, userContext)

recipe/thirdpartypasswordless/recipe.go

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,27 @@ func MakeRecipe(recipeId string, appInfo supertokens.NormalisedAppinfo, config t
107107
r.passwordlessRecipe = passwordlessInstance
108108
}
109109

110-
if len(verifiedConfig.Providers) > 0 {
111-
if thirdPartyInstance == nil {
112-
thirdPartyConfig := &tpmodels.TypeInput{
113-
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
114-
Providers: verifiedConfig.Providers,
110+
if thirdPartyInstance == nil {
111+
thirdPartyConfig := &tpmodels.TypeInput{
112+
SignInAndUpFeature: tpmodels.TypeInputSignInAndUp{
113+
Providers: verifiedConfig.Providers,
114+
},
115+
Override: &tpmodels.OverrideStruct{
116+
Functions: func(_ tpmodels.RecipeInterface) tpmodels.RecipeInterface {
117+
return recipeimplementation.MakeThirdPartyRecipeImplementation(r.RecipeImpl)
115118
},
116-
Override: &tpmodels.OverrideStruct{
117-
Functions: func(_ tpmodels.RecipeInterface) tpmodels.RecipeInterface {
118-
return recipeimplementation.MakeThirdPartyRecipeImplementation(r.RecipeImpl)
119-
},
120-
APIs: func(_ tpmodels.APIInterface) tpmodels.APIInterface {
121-
return api.GetThirdPartyIterfaceImpl(r.APIImpl)
122-
},
119+
APIs: func(_ tpmodels.APIInterface) tpmodels.APIInterface {
120+
return api.GetThirdPartyIterfaceImpl(r.APIImpl)
123121
},
124-
}
125-
thirdPartyRecipeinstance, err := thirdparty.MakeRecipe(recipeId, appInfo, thirdPartyConfig, &r.EmailDelivery, onSuperTokensAPIError)
126-
if err != nil {
127-
return Recipe{}, err
128-
}
129-
r.thirdPartyRecipe = &thirdPartyRecipeinstance
130-
} else {
131-
r.thirdPartyRecipe = thirdPartyInstance
122+
},
132123
}
124+
thirdPartyRecipeinstance, err := thirdparty.MakeRecipe(recipeId, appInfo, thirdPartyConfig, &r.EmailDelivery, onSuperTokensAPIError)
125+
if err != nil {
126+
return Recipe{}, err
127+
}
128+
r.thirdPartyRecipe = &thirdPartyRecipeinstance
129+
} else {
130+
r.thirdPartyRecipe = thirdPartyInstance
133131
}
134132

135133
return *r, nil

0 commit comments

Comments
 (0)