supertokens-node
    Preparing search index...

    Variable createResetPasswordToken

    createResetPasswordToken: (
        tenantId: string,
        userId: string,
        email: string,
        userContext?: Record<string, any>,
    ) => Promise<
        { status: "OK"; token: string }
        | { status: "UNKNOWN_USER_ID_ERROR" },
    > = Wrapper.createResetPasswordToken

    Type declaration

      • (
            tenantId: string,
            userId: string,
            email: string,
            userContext?: Record<string, any>,
        ): Promise<
            { status: "OK"; token: string }
            | { status: "UNKNOWN_USER_ID_ERROR" },
        >
      • We do not make email optional here cause we want to allow passing in primaryUserId. If we make email optional, and if the user provides a primaryUserId, then it may result in two problems:

        • there is no recipeUserId = input primaryUserId, in this case, this function will throw an error
        • There is a recipe userId = input primaryUserId, but that recipe has no email, or has wrong email compared to what the user wanted to generate a reset token for.

        And we want to allow primaryUserId being passed in.

        Parameters

        • tenantId: string
        • userId: string
        • email: string
        • OptionaluserContext: Record<string, any>

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>