Skip to content

Commit 37919ae

Browse files
committed
minor fixes
1 parent f916290 commit 37919ae

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

recipe/emailpassword/epmodels/recipeInterface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ type UpdateEmailOrPasswordResponse struct {
6363
}
6464

6565
type PasswordPolicyViolatedError struct {
66-
FailureReason *string
66+
FailureReason string
6767
}

recipe/emailpassword/recipeImplementation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func MakeRecipeImplementation(querier supertokens.Querier, getEmailPasswordConfi
173173
err := formFields[i].Validate(*password)
174174
if err != nil {
175175
errResponse := epmodels.PasswordPolicyViolatedError{
176-
FailureReason: err,
176+
FailureReason: *err,
177177
}
178178
return epmodels.UpdateEmailOrPasswordResponse{PasswordPolicyViolatedError: &errResponse}, nil
179179
}

recipe/emailpassword/updateEmailPass_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func TestUpdateEmailPass(t *testing.T) {
144144
applyPasswordPolicy := true
145145
res3, err := UpdateEmailOrPassword(data["user"].(map[string]interface{})["id"].(string), &email, &password, &applyPasswordPolicy)
146146
assert.NotNil(t, res3.PasswordPolicyViolatedError)
147-
assert.Equal(t, "Password must contain at least 8 characters, including a number", *res3.PasswordPolicyViolatedError.FailureReason)
147+
assert.Equal(t, "Password must contain at least 8 characters, including a number", res3.PasswordPolicyViolatedError.FailureReason)
148148
}
149149

150150
func TestAPICustomResponse(t *testing.T) {

recipe/thirdpartyemailpassword/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ func ResetPasswordUsingTokenWithContext(token, newPassword string, userContext s
9191
return (*instance.RecipeImpl.ResetPasswordUsingToken)(token, newPassword, userContext)
9292
}
9393

94-
func UpdateEmailOrPasswordWithContext(userId string, email *string, password *string, applyPasswordPOlicy *bool, userContext supertokens.UserContext) (epmodels.UpdateEmailOrPasswordResponse, error) {
94+
func UpdateEmailOrPasswordWithContext(userId string, email *string, password *string, applyPasswordPolicy *bool, userContext supertokens.UserContext) (epmodels.UpdateEmailOrPasswordResponse, error) {
9595
instance, err := GetRecipeInstanceOrThrowError()
9696
if err != nil {
9797
return epmodels.UpdateEmailOrPasswordResponse{}, err
9898
}
99-
return (*instance.RecipeImpl.UpdateEmailOrPassword)(userId, email, password, applyPasswordPOlicy, userContext)
99+
return (*instance.RecipeImpl.UpdateEmailOrPassword)(userId, email, password, applyPasswordPolicy, userContext)
100100
}
101101

102102
func SendEmailWithContext(input emaildelivery.EmailType, userContext supertokens.UserContext) error {

recipe/thirdpartyemailpassword/recipe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func MakeRecipe(recipeId string, appInfo supertokens.NormalisedAppinfo, config *
6565
return Recipe{}, err
6666
}
6767
var getEmailPasswordConfig = func() epmodels.TypeNormalisedInput {
68-
return emailPasswordRecipe.Config
68+
return r.emailPasswordRecipe.Config
6969
}
7070
r.RecipeImpl = verifiedConfig.Override.Functions(recipeimplementation.MakeRecipeImplementation(*emailpasswordquerierInstance, thirdpartyquerierInstance, getEmailPasswordConfig))
7171
}

0 commit comments

Comments
 (0)