Skip to content

Commit

Permalink
exposes functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Dec 12, 2023
1 parent 0858299 commit 8b6d1dd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions supertokens/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,29 @@ func DeleteUser(userId string) error {
func GetRequestFromUserContext(userContext UserContext) *http.Request {
return getRequestFromUserContext(userContext)
}

func CanCreatePrimaryUser(recipeUserId RecipeUserID, userContext ...UserContext) (CanCreatePrimaryUserResponse, error) {
accountLinkingInstance, err := getAccountLinkingRecipeInstanceOrThrowError()
if err != nil {
return CanCreatePrimaryUserResponse{}, err
}

if len(userContext) == 0 {
userContext = append(userContext, &map[string]interface{}{})
}

return (*accountLinkingInstance.RecipeImpl.CanCreatePrimaryUser)(recipeUserId, userContext[0])
}

func CreatePrimaryUser(recipeUserId RecipeUserID, userContext ...UserContext) (CreatePrimaryUserResponse, error) {
accountLinkingInstance, err := getAccountLinkingRecipeInstanceOrThrowError()
if err != nil {
return CreatePrimaryUserResponse{}, err
}

if len(userContext) == 0 {
userContext = append(userContext, &map[string]interface{}{})
}

return (*accountLinkingInstance.RecipeImpl.CreatePrimaryUser)(recipeUserId, userContext[0])
}

0 comments on commit 8b6d1dd

Please sign in to comment.