passwordless

package
v0.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 26 Imported by: 18

Documentation

Index

Constants

View Source
const RECIPE_ID = "passwordless"

Variables

View Source
var PasswordlessLoginEmailDataForTest struct {
	Email            string
	UserInputCode    *string
	UrlWithLinkCode  *string
	CodeLifetime     uint64
	PreAuthSessionId string
	UserContext      supertokens.UserContext
}
View Source
var PasswordlessLoginEmailSentForTest bool = false
View Source
var PasswordlessLoginSmsDataForTest struct {
	Phone            string
	UserInputCode    *string
	UrlWithLinkCode  *string
	CodeLifetime     uint64
	PreAuthSessionId string
	UserContext      supertokens.UserContext
}
View Source
var PasswordlessLoginSmsSentForTest bool = false

Functions

func AfterEach added in v0.5.7

func AfterEach()

func BeforeEach added in v0.5.7

func BeforeEach()

func ConsumeCodeWithLinkCode

func ConsumeCodeWithLinkCode(linkCode string, preAuthSessionID string) (plessmodels.ConsumeCodeResponse, error)

func ConsumeCodeWithLinkCodeWithContext added in v0.5.0

func ConsumeCodeWithLinkCodeWithContext(linkCode string, preAuthSessionID string, userContext supertokens.UserContext) (plessmodels.ConsumeCodeResponse, error)

func ConsumeCodeWithUserInputCode

func ConsumeCodeWithUserInputCode(deviceID string, userInputCode string, preAuthSessionID string) (plessmodels.ConsumeCodeResponse, error)

func ConsumeCodeWithUserInputCodeWithContext added in v0.5.0

func ConsumeCodeWithUserInputCodeWithContext(deviceID string, userInputCode string, preAuthSessionID string, userContext supertokens.UserContext) (plessmodels.ConsumeCodeResponse, error)

func CreateCodeWithEmail

func CreateCodeWithEmail(email string, userInputCode *string) (plessmodels.CreateCodeResponse, error)

func CreateCodeWithEmailWithContext added in v0.5.0

func CreateCodeWithEmailWithContext(email string, userInputCode *string, userContext supertokens.UserContext) (plessmodels.CreateCodeResponse, error)

func CreateCodeWithPhoneNumber

func CreateCodeWithPhoneNumber(phoneNumber string, userInputCode *string) (plessmodels.CreateCodeResponse, error)

func CreateCodeWithPhoneNumberWithContext added in v0.5.0

func CreateCodeWithPhoneNumberWithContext(phoneNumber string, userInputCode *string, userContext supertokens.UserContext) (plessmodels.CreateCodeResponse, error)

func CreateMagicLinkByEmail

func CreateMagicLinkByEmail(email string) (string, error)

func CreateMagicLinkByEmailWithContext added in v0.5.0

func CreateMagicLinkByEmailWithContext(email string, userContext supertokens.UserContext) (string, error)

func CreateMagicLinkByPhoneNumber

func CreateMagicLinkByPhoneNumber(phoneNumber string) (string, error)

func CreateMagicLinkByPhoneNumberWithContext added in v0.5.0

func CreateMagicLinkByPhoneNumberWithContext(phoneNumber string, userContext supertokens.UserContext) (string, error)

func CreateNewCodeForDevice

func CreateNewCodeForDevice(deviceID string, userInputCode *string) (plessmodels.ResendCodeResponse, error)

func CreateNewCodeForDeviceWithContext added in v0.5.0

func CreateNewCodeForDeviceWithContext(deviceID string, userInputCode *string, userContext supertokens.UserContext) (plessmodels.ResendCodeResponse, error)

func DefaultCreateAndSendCustomEmail added in v0.6.8

func DefaultCreateAndSendCustomEmail(appInfo supertokens.NormalisedAppinfo) func(email string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error

func DefaultCreateAndSendCustomTextMessage added in v0.6.8

func DefaultCreateAndSendCustomTextMessage(appInfo supertokens.NormalisedAppinfo) func(phoneNumber string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error

func DefaultValidateEmailAddress added in v0.9.9

func DefaultValidateEmailAddress(value interface{}) *string

func DefaultValidatePhoneNumber added in v0.9.9

func DefaultValidatePhoneNumber(value interface{}) *string

func DeleteEmailForUser added in v0.5.7

func DeleteEmailForUser(userID string) (plessmodels.DeleteUserResponse, error)

func DeleteEmailForUserWithContext added in v0.5.7

func DeleteEmailForUserWithContext(userID string, userContext supertokens.UserContext) (plessmodels.DeleteUserResponse, error)

func DeletePhoneNumberForUser added in v0.5.7

func DeletePhoneNumberForUser(userID string) (plessmodels.DeleteUserResponse, error)

func DeletePhoneNumberForUserWithContext added in v0.5.7

func DeletePhoneNumberForUserWithContext(userID string, userContext supertokens.UserContext) (plessmodels.DeleteUserResponse, error)

func GetUserByEmail

func GetUserByEmail(email string) (*plessmodels.User, error)

func GetUserByEmailWithContext added in v0.5.0

func GetUserByEmailWithContext(email string, userContext supertokens.UserContext) (*plessmodels.User, error)

func GetUserByID

func GetUserByID(userID string) (*plessmodels.User, error)

func GetUserByIDWithContext added in v0.5.0

func GetUserByIDWithContext(userID string, userContext supertokens.UserContext) (*plessmodels.User, error)

func GetUserByPhoneNumber

func GetUserByPhoneNumber(phoneNumber string) (*plessmodels.User, error)

func GetUserByPhoneNumberWithContext added in v0.5.0

func GetUserByPhoneNumberWithContext(phoneNumber string, userContext supertokens.UserContext) (*plessmodels.User, error)

func Init

func ListCodesByDeviceID

func ListCodesByDeviceID(deviceID string) (*plessmodels.DeviceType, error)

func ListCodesByDeviceIDWithContext added in v0.5.0

func ListCodesByDeviceIDWithContext(deviceID string, userContext supertokens.UserContext) (*plessmodels.DeviceType, error)

func ListCodesByEmail

func ListCodesByEmail(email string) ([]plessmodels.DeviceType, error)

func ListCodesByEmailWithContext added in v0.5.0

func ListCodesByEmailWithContext(email string, userContext supertokens.UserContext) ([]plessmodels.DeviceType, error)

func ListCodesByPhoneNumber

func ListCodesByPhoneNumber(phoneNumber string) ([]plessmodels.DeviceType, error)

func ListCodesByPhoneNumberWithContext added in v0.5.0

func ListCodesByPhoneNumberWithContext(phoneNumber string, userContext supertokens.UserContext) ([]plessmodels.DeviceType, error)

func ListCodesByPreAuthSessionID

func ListCodesByPreAuthSessionID(preAuthSessionID string) (*plessmodels.DeviceType, error)

func ListCodesByPreAuthSessionIDWithContext added in v0.5.0

func ListCodesByPreAuthSessionIDWithContext(preAuthSessionID string, userContext supertokens.UserContext) (*plessmodels.DeviceType, error)

func MakeRecipeImplementation added in v0.5.2

func MakeRecipeImplementation(querier supertokens.Querier) plessmodels.RecipeInterface

func MakeSMTPService added in v0.7.0

func MakeSupertokensSMSService added in v0.7.0

func MakeSupertokensSMSService(apiKey string) *smsdelivery.SmsDeliveryInterface

func MakeTwilioService added in v0.7.0

func ResetForTest

func ResetForTest()

func RevokeAllCodesByEmail

func RevokeAllCodesByEmail(email string) error

func RevokeAllCodesByEmailWithContext added in v0.5.0

func RevokeAllCodesByEmailWithContext(email string, userContext supertokens.UserContext) error

func RevokeAllCodesByPhoneNumber

func RevokeAllCodesByPhoneNumber(phoneNumber string) error

func RevokeAllCodesByPhoneNumberWithContext added in v0.5.0

func RevokeAllCodesByPhoneNumberWithContext(phoneNumber string, userContext supertokens.UserContext) error

func RevokeCode

func RevokeCode(codeID string) error

func RevokeCodeWithContext added in v0.5.0

func RevokeCodeWithContext(codeID string, userContext supertokens.UserContext) error

func SendEmail added in v0.6.8

func SendEmail(input emaildelivery.EmailType) error

func SendEmailWithContext added in v0.6.8

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

func SendSms added in v0.6.8

func SendSms(input smsdelivery.SmsType) error

func SendSmsWithContext added in v0.6.8

func SendSmsWithContext(input smsdelivery.SmsType, userContext supertokens.UserContext) error

func SignInUpByEmail

func SignInUpByEmail(email string) (struct {
	PreAuthSessionID string
	CreatedNewUser   bool
	User             plessmodels.User
}, error)

func SignInUpByEmailWithContext added in v0.5.0

func SignInUpByEmailWithContext(email string, userContext supertokens.UserContext) (struct {
	PreAuthSessionID string
	CreatedNewUser   bool
	User             plessmodels.User
}, error)

func SignInUpByPhoneNumber

func SignInUpByPhoneNumber(phoneNumber string) (struct {
	PreAuthSessionID string
	CreatedNewUser   bool
	User             plessmodels.User
}, error)

func SignInUpByPhoneNumberWithContext added in v0.5.0

func SignInUpByPhoneNumberWithContext(phoneNumber string, userContext supertokens.UserContext) (struct {
	PreAuthSessionID string
	CreatedNewUser   bool
	User             plessmodels.User
}, error)

func UpdateUser

func UpdateUser(userID string, email *string, phoneNumber *string) (plessmodels.UpdateUserResponse, error)

func UpdateUserWithContext added in v0.5.0

func UpdateUserWithContext(userID string, email *string, phoneNumber *string, userContext supertokens.UserContext) (plessmodels.UpdateUserResponse, error)

Types

type Recipe

type Recipe struct {
	RecipeModule  supertokens.RecipeModule
	Config        plessmodels.TypeNormalisedInput
	RecipeImpl    plessmodels.RecipeInterface
	APIImpl       plessmodels.APIInterface
	EmailDelivery emaildelivery.Ingredient
	SmsDelivery   smsdelivery.Ingredient
}

func GetRecipeInstance added in v0.9.9

func GetRecipeInstance() *Recipe

func GetRecipeInstanceOrThrowError added in v0.9.14

func GetRecipeInstanceOrThrowError() (*Recipe, error)

func MakeRecipe

func MakeRecipe(recipeId string, appInfo supertokens.NormalisedAppinfo, config plessmodels.TypeInput, emailDeliveryIngredient *emaildelivery.Ingredient, smsDeliveryIngredient *smsdelivery.Ingredient, onSuperTokensAPIError func(err error, req *http.Request, res http.ResponseWriter)) (Recipe, error)
func (r *Recipe) CreateMagicLink(email *string, phoneNumber *string, userContext supertokens.UserContext) (string, error)

func (*Recipe) SignInUp added in v0.5.2

func (r *Recipe) SignInUp(email *string, phoneNumber *string, userContext supertokens.UserContext) (struct {
	PreAuthSessionID string
	CreatedNewUser   bool
	User             plessmodels.User
}, error)

Directories

Path Synopsis
emaildelivery
smsdelivery

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL