dairyfoodgoauth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateId

func GenerateId(prefix string) (string, error)

Types

type OtpLogin

type OtpLogin struct {
	Id          string   `firestore:"id"`
	UserId      string   `firestore:"userId"`
	PhoneNumber string   `firestore:"phoneNumber"`
	Roles       string   `firestore:"roles"`
	Otp         string   `firestore:"otp"`
	Region      []string `firestore:"region"`
	CreatedAt   int64    `firestore:"createdAt"`
}

func NewOtpLogin

func NewOtpLogin(userId, phoneNumber, roles string, region []string) (*OtpLogin, error)

type OtpVerifyPhoneNumber

type OtpVerifyPhoneNumber struct {
	Id          string `firestore:"id"`
	PhoneNumber string `firestore:"phoneNumber"`
	Otp         string `firestore:"otp"`
	CreatedAt   int64  `firestore:"createdAt"`
}

func NewOtpVerifyPhoneNumber

func NewOtpVerifyPhoneNumber(phoneNumber string) (*OtpVerifyPhoneNumber, error)

type User

type User struct {
	Id          string   `json:"user_id"`
	PhoneNumber string   `json:"phoneNumber"`
	Roles       string   `json:"roles"`
	Region      []string `json:"region"`
	Iss         string   `json:"iss"`
	Aud         string   `json:"aud"`
	AuthTime    int64    `json:"auth_time"`
	Sub         string   `json:"sub"`
	Iat         int64    `json:"iat"`
	Exp         int64    `json:"exp"`
}

func Authorization

func Authorization(auth *auth.Client, ctx context.Context, roles ...roles.Roles) (*User, error)

func (*User) IsBranchAdmin

func (it *User) IsBranchAdmin() bool

func (*User) IsCourier

func (it *User) IsCourier() bool

func (*User) IsCustomer

func (it *User) IsCustomer() bool

func (*User) IsFinanceAdmin

func (it *User) IsFinanceAdmin() bool

func (*User) IsFoodServiceAM

func (it *User) IsFoodServiceAM() bool

func (*User) IsFoodServiceGM

func (it *User) IsFoodServiceGM() bool

func (*User) IsFoodServiceNSM

func (it *User) IsFoodServiceNSM() bool

func (*User) IsFoodServiceRM

func (it *User) IsFoodServiceRM() bool

func (*User) IsFoodServiceSales

func (it *User) IsFoodServiceSales() bool

func (*User) IsRetailAM

func (it *User) IsRetailAM() bool

func (*User) IsRetailDir

func (it *User) IsRetailDir() bool

func (*User) IsRetailGM

func (it *User) IsRetailGM() bool

func (*User) IsRetailRM

func (it *User) IsRetailRM() bool

func (*User) IsRetailSales

func (it *User) IsRetailSales() bool

func (*User) IsSalesAdmin

func (it *User) IsSalesAdmin() bool

func (*User) IsSystemAdmin

func (it *User) IsSystemAdmin() bool

func (*User) IsWalkInCustomer

func (it *User) IsWalkInCustomer() bool

func (*User) IsWarehouseAdmin

func (it *User) IsWarehouseAdmin() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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