auth

package
v0.0.0-...-a9fa8a7 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	Id           primitive.ObjectID `bson:"_id,omitempty"`
	UserId       string             `bson:"user_id"`
	RoleCode     int                `bson:"role_code"`
	AccessToken  string             `bson:"access_token"`
	RefreshToken string             `bson:"refresh_token"`
	CreatedAt    time.Time          `bson:"created_at"`
	UpdatedAt    time.Time          `bson:"updated_at"`
}

type CredentialRes

type CredentialRes struct {
	Id           string    `json:"_id"`
	UserId       string    `json:"user_id"`
	RoleCode     int       `json:"role_code"`
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type InsertUserRole

type InsertUserRole struct {
	UserId   string `json:"user_id" validate:"required"`
	RoleCode []int  `json:"role_id" validate:"required"`
}

type LogoutReq

type LogoutReq struct {
	CredentialId string `json:"credential_id" form:"credential_id" validate:"required,max=64"`
}

type OtpModel

type OtpModel struct {
	Email     string    `json:"email" bson:"email"`
	Otp       string    `json:"otp" bson:"otp"`
	ExpiresAt time.Time `json:"expires_at" bson:"expires_at"`
}

type OtpRequestReq

type OtpRequestReq struct {
	Email string `json:"email" form:"email" validate:"required,max=255"`
}

type OtpVerificationReq

type OtpVerificationReq struct {
	Email string `json:"email" form:"email" validate:"required,max=255"`
	Otp   string `json:"otp" form:"otp" validate:"required,max=6"`
}

type ProfileIntercepter

type ProfileIntercepter struct {
	*user.UserProfile
	Credential *CredentialRes `json:"credential"`
}

type RefreshTokenReq

type RefreshTokenReq struct {
	CredentialId string `json:"credential_id" form:"credential_id" validate:"required,max=64"`
	RefreshToken string `json:"refresh_token" form:"refresh_token" validate:"required,max=500"`
}

type Role

type Role struct {
	Id    primitive.ObjectID `json:"_id" bson:"_id,omitempty"`
	Title string             `json:"title" bson:"title"`
	Code  int                `json:"code" bson:"code"`
}

type UpdateRefreshTokenReq

type UpdateRefreshTokenReq struct {
	UserId       string    `bson:"user_id"`
	AccessToken  string    `bson:"access_token"`
	RefreshToken string    `bson:"refresh_token"`
	UpdatedAt    time.Time `bson:"updated_at"`
}

type UserLoginReq

type UserLoginReq struct {
	Email    string `json:"email" form:"email" validate:"required,email,max=255"`
	Password string `json:"password" form:"password" validate:"required,max=32"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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