Documentation
¶
Index ¶
- type APIInterface
- type APIOptions
- type Code
- type ConsumeCodePOSTResponse
- type ConsumeCodeResponse
- type ContactMethodEmailConfig
- type ContactMethodEmailOrPhoneConfig
- type ContactMethodPhoneConfig
- type CreateCodePOSTResponse
- type CreateCodeResponse
- type DeleteUserResponse
- type DeviceType
- type EmailExistsGETResponse
- type NewCode
- type OverrideStruct
- type PhoneNumberExistsGETResponse
- type RecipeInterface
- type ResendCodePOSTResponse
- type ResendCodeResponse
- type TypeInput
- type TypeNormalisedInput
- type UpdateUserResponse
- type User
- type UserInputCodeWithDeviceID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIInterface ¶
type APIInterface struct {
CreateCodePOST *func(email *string, phoneNumber *string, options APIOptions, userContext supertokens.UserContext) (CreateCodePOSTResponse, error)
ResendCodePOST *func(deviceID string, preAuthSessionID string, options APIOptions, userContext supertokens.UserContext) (ResendCodePOSTResponse, error)
ConsumeCodePOST *func(userInput *UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, options APIOptions, userContext supertokens.UserContext) (ConsumeCodePOSTResponse, error)
EmailExistsGET *func(email string, options APIOptions, userContext supertokens.UserContext) (EmailExistsGETResponse, error)
PhoneNumberExistsGET *func(phoneNumber string, options APIOptions, userContext supertokens.UserContext) (PhoneNumberExistsGETResponse, error)
}
type APIOptions ¶
type APIOptions struct {
RecipeImplementation RecipeInterface
Config TypeNormalisedInput
RecipeID string
Req *http.Request
Res http.ResponseWriter
OtherHandler http.HandlerFunc
}
type ConsumeCodePOSTResponse ¶
type ConsumeCodePOSTResponse struct {
OK *struct {
CreatedNewUser bool
User User
Session sessmodels.SessionContainer
}
IncorrectUserInputCodeError *struct {
FailedCodeInputAttemptCount int
MaximumCodeInputAttempts int
}
ExpiredUserInputCodeError *struct {
FailedCodeInputAttemptCount int
MaximumCodeInputAttempts int
}
RestartFlowError *struct{}
GeneralError *struct {
Message string
}
}
type ConsumeCodeResponse ¶
type ConsumeCodeResponse struct {
OK *struct {
CreatedNewUser bool
User User
}
IncorrectUserInputCodeError *struct {
FailedCodeInputAttemptCount int
MaximumCodeInputAttempts int
}
ExpiredUserInputCodeError *struct {
FailedCodeInputAttemptCount int
MaximumCodeInputAttempts int
}
RestartFlowError *struct{}
}
type ContactMethodEmailConfig ¶
type ContactMethodEmailConfig struct {
Enabled bool
ValidateEmailAddress func(email interface{}) *string
CreateAndSendCustomEmail func(email string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error
}
type ContactMethodEmailOrPhoneConfig ¶
type ContactMethodEmailOrPhoneConfig struct {
Enabled bool
ValidateEmailAddress func(email interface{}) *string
CreateAndSendCustomEmail func(email string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error
ValidatePhoneNumber func(phoneNumber interface{}) *string
CreateAndSendCustomTextMessage func(phoneNumber string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error
}
type ContactMethodPhoneConfig ¶
type ContactMethodPhoneConfig struct {
Enabled bool
ValidatePhoneNumber func(phoneNumber interface{}) *string
CreateAndSendCustomTextMessage func(phoneNumber string, userInputCode *string, urlWithLinkCode *string, codeLifetime uint64, preAuthSessionId string, userContext supertokens.UserContext) error
}
type CreateCodePOSTResponse ¶
type CreateCodeResponse ¶
type CreateCodeResponse struct {
OK *NewCode
}
type DeleteUserResponse ¶ added in v0.5.7
type DeleteUserResponse struct {
OK *struct{}
UnknownUserIdError *struct{}
}
type DeviceType ¶
type EmailExistsGETResponse ¶
type EmailExistsGETResponse struct {
OK *struct{ Exists bool }
}
type OverrideStruct ¶
type OverrideStruct struct {
Functions func(originalImplementation RecipeInterface) RecipeInterface
APIs func(originalImplementation APIInterface) APIInterface
}
type PhoneNumberExistsGETResponse ¶
type PhoneNumberExistsGETResponse struct {
OK *struct{ Exists bool }
}
type RecipeInterface ¶
type RecipeInterface struct {
CreateCode *func(email *string, phoneNumber *string, userInputCode *string, userContext supertokens.UserContext) (CreateCodeResponse, error)
CreateNewCodeForDevice *func(deviceID string, userInputCode *string, userContext supertokens.UserContext) (ResendCodeResponse, error)
ConsumeCode *func(userInput *UserInputCodeWithDeviceID, linkCode *string, preAuthSessionID string, userContext supertokens.UserContext) (ConsumeCodeResponse, error)
GetUserByID *func(userID string, userContext supertokens.UserContext) (*User, error)
GetUserByEmail *func(email string, userContext supertokens.UserContext) (*User, error)
GetUserByPhoneNumber *func(phoneNumber string, userContext supertokens.UserContext) (*User, error)
UpdateUser *func(userID string, email *string, phoneNumber *string, userContext supertokens.UserContext) (UpdateUserResponse, error)
DeleteEmailForUser *func(userID string, userContext supertokens.UserContext) (DeleteUserResponse, error)
DeletePhoneNumberForUser *func(userID string, userContext supertokens.UserContext) (DeleteUserResponse, error)
RevokeAllCodes *func(email *string, phoneNumber *string, userContext supertokens.UserContext) error
RevokeCode *func(codeID string, userContext supertokens.UserContext) error
ListCodesByEmail *func(email string, userContext supertokens.UserContext) ([]DeviceType, error)
ListCodesByPhoneNumber *func(phoneNumber string, userContext supertokens.UserContext) ([]DeviceType, error)
ListCodesByDeviceID *func(deviceID string, userContext supertokens.UserContext) (*DeviceType, error)
ListCodesByPreAuthSessionID *func(preAuthSessionID string, userContext supertokens.UserContext) (*DeviceType, error)
}
type ResendCodePOSTResponse ¶
type ResendCodePOSTResponse struct {
OK *struct{}
ResetFlowError *struct{}
GeneralError *struct {
Message string
}
}
type ResendCodeResponse ¶
type ResendCodeResponse struct {
OK *NewCode
RestartFlowError *struct{}
UserInputCodeAlreadyUsedError *struct{}
}
type TypeInput ¶
type TypeInput struct {
ContactMethodPhone ContactMethodPhoneConfig
ContactMethodEmail ContactMethodEmailConfig
ContactMethodEmailOrPhone ContactMethodEmailOrPhoneConfig
FlowType string
GetLinkDomainAndPath func(email *string, phoneNumber *string, userContext supertokens.UserContext) (string, error)
GetCustomUserInputCode func(userContext supertokens.UserContext) (string, error)
Override *OverrideStruct
}
type TypeNormalisedInput ¶
type TypeNormalisedInput struct {
ContactMethodPhone ContactMethodPhoneConfig
ContactMethodEmail ContactMethodEmailConfig
ContactMethodEmailOrPhone ContactMethodEmailOrPhoneConfig
FlowType string
GetLinkDomainAndPath func(email *string, phoneNumber *string, userContext supertokens.UserContext) (string, error)
GetCustomUserInputCode func(userContext supertokens.UserContext) (string, error)
Override OverrideStruct
}
type UpdateUserResponse ¶
type UpdateUserResponse struct {
OK *struct{}
UnknownUserIdError *struct{}
EmailAlreadyExistsError *struct{}
PhoneNumberAlreadyExistsError *struct{}
}
Click to show internal directories.
Click to hide internal directories.