auth

package
v0.0.0-...-57241a5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCors

func NewCors() gin.HandlerFunc

Types

type AuthController

type AuthController struct {
	// contains filtered or unexported fields
}

func NewAuthController

func NewAuthController(authService IAuthService) *AuthController

func (*AuthController) ForgotPassword

func (ac *AuthController) ForgotPassword(c *gin.Context)

func (*AuthController) Login

func (ac *AuthController) Login(c *gin.Context)

func (*AuthController) Logout

func (ac *AuthController) Logout(c *gin.Context)

func (*AuthController) ResetPassword

func (ac *AuthController) ResetPassword(c *gin.Context)

func (*AuthController) Verify

func (ac *AuthController) Verify(c *gin.Context)

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

func NewAuthMiddleWare

func NewAuthMiddleWare(accessTokenSecret string, tutorRepo tutor.IMiddlewareTutorRepo, studentRepo student.IMiddlewareStudentRepo, accessTokenManager utils.IMiddlewareAccessTokenManager) *AuthMiddleware

func (*AuthMiddleware) Authentication

func (amw *AuthMiddleware) Authentication() gin.HandlerFunc

func (*AuthMiddleware) Authorization

func (amw *AuthMiddleware) Authorization(role user.Role) gin.HandlerFunc

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(tutorRepo tutor.ITutorRepo, studentRepo student.IStudentRepo, subjectRepo subject.ISubjectRepo, accessTokenManager utils.IAccessTokenManager, verificationTokenManager utils.IVerificationTokenManager, emailManager utils.IEmailManager, baseUrl string) *AuthService

func (*AuthService) ForgotPassword

func (as *AuthService) ForgotPassword(email string) error

func (*AuthService) Login

func (as *AuthService) Login(email, password string) (interface{}, *utils.AccessTokenDetails, error)

func (*AuthService) Logout

func (as *AuthService) Logout(accessUuid string) error

func (*AuthService) ResetPassword

func (as *AuthService) ResetPassword(email, password, token string) error

func (*AuthService) Verify

func (as *AuthService) Verify(email, token string) error

type IAuthService

type IAuthService interface {
	Verify(email, token string) error
	Login(email, password string) (interface{}, *utils.AccessTokenDetails, error)
	Logout(accessUuid string) error
	ForgotPassword(email string) error
	ResetPassword(email, password, token string) error
}

Jump to

Keyboard shortcuts

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