tpmodels

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 3 Imported by: 51

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInterface

type APIInterface struct {
	AuthorisationUrlGET      *func(provider TypeProvider, options APIOptions) (AuthorisationUrlGETResponse, error)
	SignInUpPOST             *func(provider TypeProvider, code string, authCodeResponse interface{}, redirectURI string, options APIOptions) (SignInUpPOSTResponse, error)
	AppleRedirectHandlerPOST *func(code string, state string, options APIOptions) error
}

type APIOptions

type APIOptions struct {
	RecipeImplementation                  RecipeInterface
	EmailVerificationRecipeImplementation evmodels.RecipeInterface
	Config                                TypeNormalisedInput
	RecipeID                              string
	Providers                             []TypeProvider
	Req                                   *http.Request
	Res                                   http.ResponseWriter
	OtherHandler                          http.HandlerFunc
	AppInfo                               supertokens.NormalisedAppinfo
}

type AccessTokenAPI

type AccessTokenAPI struct {
	URL    string
	Params map[string]string
}

type AppleClientSecret added in v0.2.0

type AppleClientSecret struct {
	KeyId      string
	PrivateKey string
	TeamId     string
}

type AppleConfig added in v0.2.0

type AppleConfig struct {
	ClientID              string
	ClientSecret          AppleClientSecret
	Scope                 []string
	AuthorisationRedirect *struct {
		Params map[string]interface{}
	}
	IsDefault bool
}

type AuthorisationRedirect

type AuthorisationRedirect struct {
	URL    string
	Params map[string]interface{}
}

type AuthorisationUrlGETResponse

type AuthorisationUrlGETResponse struct {
	OK *struct{ Url string }
}

type EmailStruct

type EmailStruct struct {
	ID         string `json:"id"`
	IsVerified bool   `json:"isVerified"`
}

type FacebookConfig

type FacebookConfig struct {
	ClientID     string
	ClientSecret string
	Scope        []string
	IsDefault    bool
}

type GithubConfig

type GithubConfig struct {
	ClientID              string
	ClientSecret          string
	Scope                 []string
	AuthorisationRedirect *struct {
		Params map[string]interface{}
	}
	IsDefault bool
}

type GoogleConfig

type GoogleConfig struct {
	ClientID              string
	ClientSecret          string
	Scope                 []string
	AuthorisationRedirect *struct {
		Params map[string]interface{}
	}
	IsDefault bool
}

type OverrideStruct

type OverrideStruct struct {
	Functions                func(originalImplementation RecipeInterface) RecipeInterface
	APIs                     func(originalImplementation APIInterface) APIInterface
	EmailVerificationFeature *evmodels.OverrideStruct
}

type RecipeInterface

type RecipeInterface struct {
	GetUserByID             *func(userID string) (*User, error)
	GetUsersByEmail         *func(email string) ([]User, error)
	GetUserByThirdPartyInfo *func(thirdPartyID string, thirdPartyUserID string) (*User, error)
	SignInUp                *func(thirdPartyID string, thirdPartyUserID string, email EmailStruct) (SignInUpResponse, error)
}

type SignInUpPOSTResponse

type SignInUpPOSTResponse struct {
	OK *struct {
		CreatedNewUser   bool
		User             User
		AuthCodeResponse interface{}
	}
	NoEmailGivenByProviderError *struct{}
	FieldError                  *struct{ Error string }
}

type SignInUpResponse

type SignInUpResponse struct {
	OK *struct {
		CreatedNewUser bool
		User           User
	}
	FieldError *struct{ Error string }
}

type TypeInput

type TypeInput struct {
	SignInAndUpFeature       TypeInputSignInAndUp
	EmailVerificationFeature *TypeInputEmailVerificationFeature
	Override                 *OverrideStruct
}

type TypeInputEmailVerificationFeature

type TypeInputEmailVerificationFeature struct {
	GetEmailVerificationURL  func(user User) (string, error)
	CreateAndSendCustomEmail func(user User, emailVerificationURLWithToken string)
}

type TypeInputSignInAndUp

type TypeInputSignInAndUp struct {
	Providers []TypeProvider
}

type TypeNormalisedInput

type TypeNormalisedInput struct {
	SignInAndUpFeature       TypeNormalisedInputSignInAndUp
	EmailVerificationFeature evmodels.TypeInput
	Override                 OverrideStruct
}

type TypeNormalisedInputSignInAndUp

type TypeNormalisedInputSignInAndUp struct {
	Providers []TypeProvider
}

type TypeProvider

type TypeProvider struct {
	ID        string
	Get       func(redirectURI *string, authCodeFromRequest *string) TypeProviderGetResponse
	IsDefault bool
}

type TypeProviderGetResponse

type TypeProviderGetResponse struct {
	AccessTokenAPI        AccessTokenAPI
	AuthorisationRedirect AuthorisationRedirect
	GetProfileInfo        func(authCodeResponse interface{}) (UserInfo, error)
	GetClientId           func() string
	GetRedirectURI        func() (string, error)
}

type User

type User struct {
	ID         string
	TimeJoined uint64
	Email      string
	ThirdParty struct {
		ID     string
		UserID string
	}
}

type UserInfo

type UserInfo struct {
	ID    string
	Email *EmailStruct
}

Jump to

Keyboard shortcuts

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