tpmodels

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 4 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, userContext supertokens.UserContext) (AuthorisationUrlGETResponse, error)
	SignInUpPOST             *func(provider TypeProvider, code string, authCodeResponse interface{}, redirectURI string, options APIOptions, userContext supertokens.UserContext) (SignInUpPOSTResponse, error)
	AppleRedirectHandlerPOST *func(code string, state string, options APIOptions, userContext supertokens.UserContext) error
}

type APIOptions

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

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 }
	GeneralError *supertokens.GeneralErrorResponse
}

type DiscordConfig added in v0.3.0

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

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 GoogleWorkspacesConfig added in v0.3.0

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

type OverrideStruct

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

type RecipeInterface

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

type SignInUpPOSTResponse

type SignInUpPOSTResponse struct {
	OK *struct {
		CreatedNewUser   bool
		User             User
		Session          sessmodels.SessionContainer
		AuthCodeResponse interface{}
	}
	NoEmailGivenByProviderError *struct{}
	GeneralError                *supertokens.GeneralErrorResponse
}

type SignInUpResponse

type SignInUpResponse struct {
	OK *struct {
		CreatedNewUser bool
		User           User
	}
}

type TypeInput

type TypeInput struct {
	SignInAndUpFeature TypeInputSignInAndUp
	Override           *OverrideStruct
}

type TypeInputSignInAndUp

type TypeInputSignInAndUp struct {
	Providers []TypeProvider
}

type TypeNormalisedInput

type TypeNormalisedInput struct {
	SignInAndUpFeature TypeNormalisedInputSignInAndUp
	Override           OverrideStruct
}

type TypeNormalisedInputSignInAndUp

type TypeNormalisedInputSignInAndUp struct {
	Providers []TypeProvider
}

type TypeProvider

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

type TypeProviderGetResponse

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

type User

type User struct {
	ID         string `json:"id"`
	TimeJoined uint64 `json:"timeJoined"`
	Email      string `json:"email"`
	ThirdParty struct {
		ID     string `json:"id"`
		UserID string `json:"userId"`
	} `json:"thirdParty"`
}

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