auth

package
v0.0.171 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLoginTimeout = errors.New("timed out")

Functions

func GenerateLoginOTP added in v0.0.36

func GenerateLoginOTP(ctx context.Context, logger logger.Logger, baseUrl string) (string, bool, error)

func Logout

func Logout()

func VerifySignupOTP added in v0.0.89

func VerifySignupOTP(ctx context.Context, logger logger.Logger, baseUrl string, otp string) (string, string, int64, error)

Types

type LoginResult

type LoginResult struct {
	APIKey  string
	UserId  string
	Expires time.Time
}

func PollForLoginCompletion added in v0.0.36

func PollForLoginCompletion(ctx context.Context, logger logger.Logger, baseUrl string, otp string) (*LoginResult, error)

type OTPCompleteResponse added in v0.0.36

type OTPCompleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    *struct {
		APIKey  string `json:"apiKey"`
		UserId  string `json:"userId"`
		Expires int64  `json:"expires"`
	} `json:"data,omitempty"`
}

type OTPStartResponse added in v0.0.36

type OTPStartResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    struct {
		OTP string `json:"otp"`
	} `json:"data"`
}

type Organization added in v0.0.69

type Organization struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type User added in v0.0.36

type User struct {
	FirstName     string         `json:"firstName"`
	LastName      string         `json:"lastName"`
	Organizations []Organization `json:"organizations"`
}

func GetUser added in v0.0.36

func GetUser(ctx context.Context, logger logger.Logger, baseUrl string, apiKey string) (*User, error)

type UserResponse added in v0.0.36

type UserResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    *User  `json:"data"`
}

type VerifySignupOTPResponse added in v0.0.89

type VerifySignupOTPResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    struct {
		UserId  string `json:"userId"`
		APIKey  string `json:"apiKey"`
		Expires int64  `json:"expiresAt"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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