authbiz

package
v0.0.0-...-d64eb31 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthBiz

func NewAuthBiz(serviceContext srvctx.ServiceContext, repo AuthRepository, userRepo UserRepository, jwtProvider core.JWTProvider, hasher Hasher, ps pubsub.Pubsub) *authBiz

Types

type AuthBiz

type AuthBiz interface {
	Register(c context.Context, register *authmodel.AuthRegister) error
	Login(c context.Context, user *authmodel.AuthEmailPassword) (*authmodel.TokenResponse, error)
	ForgotPassword(c context.Context, email string) error
	ResetPasswordWithPin(c context.Context, email, pin, password string) error
	ResetPasswordWithRequester(c context.Context, requester core.Requester, password string) error
	CheckForgotPasswordPin(c context.Context, email, pin string) error
}

type AuthRepository

type AuthRepository interface {
	Create(ctx context.Context, register *authmodel.Auth) error
	FindByEmail(ctx context.Context, email string) (*authmodel.Auth, error)
	FindByUserId(ctx context.Context, id int) (*authmodel.Auth, error)
	ForgotPassword(c context.Context, email, pin string) error
	CheckForgotPasswordPin(c context.Context, email, pin string) error
	UpdatePassword(c context.Context, email, password, salt string) error
}

type Hasher

type Hasher interface {
	Hash(string) string
}

type UserRepository

type UserRepository interface {
	CreateUser(ctx context.Context, firstName, lastName, email string) (newId int, err error)
}

Jump to

Keyboard shortcuts

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