auth

package
v0.0.0-...-fad68f1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthSchema

type AuthSchema struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

func NewAuth

func NewAuth() *AuthSchema

func (*AuthSchema) Authenticate

func (l *AuthSchema) Authenticate(config *medusa.Config) (*AuthenticateResponse, error)

func (*AuthSchema) SetEmail

func (l *AuthSchema) SetEmail(email string) *AuthSchema

func (*AuthSchema) SetPassword

func (l *AuthSchema) SetPassword(password string) *AuthSchema

type AuthenticateData

type AuthenticateData struct {
	Customer *schema.Customer `json:"customer,omitempty"`
}

type AuthenticateResponse

type AuthenticateResponse struct {
	// Success response
	Data *AuthenticateData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

type DeleteSessionResponse

type DeleteSessionResponse struct {
	// Success response
	Data any

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

func DeleteSession

func DeleteSession(config *medusa.Config) (*DeleteSessionResponse, error)

Logout current active user

type ExistsData

type ExistsData struct {
	// Whether email exists or not.
	Exists bool `json:"exists"`
}

type ExistsResponse

type ExistsResponse struct {
	// Success response
	Data *ExistsData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

func Exists

func Exists(email string, config *nedusa.Config) (*ExistsResponse, error)

verify customer emaail address

type GetSessionData

type GetSessionData struct {
	Customer *schema.Customer `json:"customer,omitempty"`
}

type GetSessionResponse

type GetSessionResponse struct {
	// Success response
	Data *GetSessionData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

func GetSession

func GetSession(config *medusa.Config) (*GetSessionResponse, error)

Gets the currently logged in Customer.

Jump to

Keyboard shortcuts

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