evmodels

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInterface

type APIInterface struct {
	VerifyEmailPOST              *func(token string, sessionContainer sessmodels.SessionContainer, options APIOptions, userContext supertokens.UserContext) (VerifyEmailPOSTResponse, error)
	IsEmailVerifiedGET           *func(sessionContainer sessmodels.SessionContainer, options APIOptions, userContext supertokens.UserContext) (IsEmailVerifiedGETResponse, error)
	GenerateEmailVerifyTokenPOST *func(sessionContainer sessmodels.SessionContainer, options APIOptions, userContext supertokens.UserContext) (GenerateEmailVerifyTokenPOSTResponse, error)
}

type APIOptions

type APIOptions struct {
	RecipeImplementation RecipeInterface
	AppInfo              supertokens.NormalisedAppinfo
	Config               TypeNormalisedInput
	RecipeID             string
	Req                  *http.Request
	Res                  http.ResponseWriter
	OtherHandler         http.HandlerFunc
	EmailDelivery        emaildelivery.Ingredient
	GetEmailForUserID    TypeGetEmailForUserID
}

type CreateEmailVerificationTokenResponse

type CreateEmailVerificationTokenResponse struct {
	OK *struct {
		Token string
	}
	EmailAlreadyVerifiedError *struct{}
}

type GenerateEmailVerifyTokenPOSTResponse

type GenerateEmailVerifyTokenPOSTResponse struct {
	OK                        *struct{}
	EmailAlreadyVerifiedError *struct{}
	GeneralError              *supertokens.GeneralErrorResponse
}

type IsEmailVerifiedGETResponse

type IsEmailVerifiedGETResponse struct {
	OK *struct {
		IsVerified bool
	}
	GeneralError *supertokens.GeneralErrorResponse
}

type OverrideStruct

type OverrideStruct struct {
	Functions func(originalImplementation RecipeInterface) RecipeInterface
	APIs      func(originalImplementation APIInterface) APIInterface
}

type RecipeInterface

type RecipeInterface struct {
	CreateEmailVerificationToken  *func(userID, email string, userContext supertokens.UserContext) (CreateEmailVerificationTokenResponse, error)
	VerifyEmailUsingToken         *func(token string, userContext supertokens.UserContext) (VerifyEmailUsingTokenResponse, error)
	IsEmailVerified               *func(userID, email string, userContext supertokens.UserContext) (bool, error)
	RevokeEmailVerificationTokens *func(userId, email string, userContext supertokens.UserContext) (RevokeEmailVerificationTokensResponse, error)
	UnverifyEmail                 *func(userId, email string, userContext supertokens.UserContext) (UnverifyEmailResponse, error)
}

type RevokeEmailVerificationTokensResponse

type RevokeEmailVerificationTokensResponse struct {
	OK *struct{}
}

type TypeEmailInfo added in v0.9.0

type TypeEmailInfo struct {
	OK *struct {
		Email string
	}
	EmailDoesNotExistError *struct{}
	UnknownUserIDError     *struct{}
}

type TypeGetEmailForUserID added in v0.9.0

type TypeGetEmailForUserID func(userID string, userContext supertokens.UserContext) (TypeEmailInfo, error)

type TypeInput

type TypeInput struct {
	Mode                     TypeMode
	GetEmailForUserID        TypeGetEmailForUserID
	CreateAndSendCustomEmail func(user User, emailVerificationURLWithToken string, userContext supertokens.UserContext) // Deprecated: Use EmailDelivery instead.
	Override                 *OverrideStruct
	EmailDelivery            *emaildelivery.TypeInput
}

type TypeMode added in v0.9.0

type TypeMode string
const (
	ModeRequired TypeMode = "REQUIRED"
	ModeOptional TypeMode = "OPTIONAL"
)

type TypeNormalisedInput

type TypeNormalisedInput struct {
	Mode                   TypeMode
	GetEmailForUserID      TypeGetEmailForUserID
	Override               OverrideStruct
	GetEmailDeliveryConfig func() emaildelivery.TypeInputWithService
}

type UnverifyEmailResponse

type UnverifyEmailResponse struct {
	OK *struct{}
}

type User

type User struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

type VerifyEmailPOSTResponse added in v0.7.0

type VerifyEmailPOSTResponse struct {
	OK *struct {
		User User
	}
	EmailVerificationInvalidTokenError *struct{}
	GeneralError                       *supertokens.GeneralErrorResponse
}

type VerifyEmailUsingTokenResponse

type VerifyEmailUsingTokenResponse struct {
	OK *struct {
		User User
	}
	EmailVerificationInvalidTokenError *struct{}
}

Jump to

Keyboard shortcuts

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