Documentation ¶
Index ¶
- Constants
- func AuthMiddleware(c *fiber.Ctx) error
- type Auth
- func (a *Auth) GetLoginPath() string
- func (a *Auth) GetOtpPath() string
- func (a *Auth) GetRegisterPath() string
- func (a *Auth) Initialize()
- func (a *Auth) SetOtpSender()
- func (a *Auth) SetRoutes()
- func (a *Auth) SetSmsProvider(provider ISmsProvider)
- func (a *Auth) SetUserRepository(subject IUserRepository)
- type AuthMiddlewareHandler
- type Config
- type GormRepository
- type HeaderBearer
- type ISmsProvider
- type IUserRepository
- type OtpBaseUserModel
- type OtpCheckerResponse
- type OtpCode
- type OtpCodeRepository
- type OtpModel
- type Router
Constants ¶
View Source
const ( PathAuth = "/auth" PathRegister = "/register" PathLogin = "/login" PathOtp = "/otp" )
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶ added in v1.0.2
func AuthMiddleware(c *fiber.Ctx) error
Types ¶
type Auth ¶
func (*Auth) GetLoginPath ¶
func (*Auth) GetOtpPath ¶
func (*Auth) GetRegisterPath ¶
func (*Auth) Initialize ¶
func (a *Auth) Initialize()
func (*Auth) SetOtpSender ¶
func (a *Auth) SetOtpSender()
func (*Auth) SetSmsProvider ¶
func (a *Auth) SetSmsProvider(provider ISmsProvider)
func (*Auth) SetUserRepository ¶
func (a *Auth) SetUserRepository(subject IUserRepository)
type AuthMiddlewareHandler ¶
type AuthMiddlewareHandler struct { Header HeaderBearer Token *jwt.Token Claims jwt.MapClaims }
func (*AuthMiddlewareHandler) GetMappedClaims ¶
func (a *AuthMiddlewareHandler) GetMappedClaims() (jwt.MapClaims, bool)
func (*AuthMiddlewareHandler) GetTokenString ¶
func (a *AuthMiddlewareHandler) GetTokenString() string
func (*AuthMiddlewareHandler) HasBearer ¶
func (a *AuthMiddlewareHandler) HasBearer() bool
func (*AuthMiddlewareHandler) ParseToken ¶
func (a *AuthMiddlewareHandler) ParseToken() (*jwt.Token, error)
type Config ¶
type Config struct { OtpHandler fiber.Handler LoginHandler fiber.Handler RegisterHandler fiber.Handler AuthMiddleware func(c *fiber.Ctx) error SmsProvider ISmsProvider UserRepository IUserRepository OtpCodeRepository OtpCodeRepository SendOtp func(phone string, code string) error }
type GormRepository ¶
type HeaderBearer ¶
type HeaderBearer struct {
Authorization string `reqHeader:"Authorization"`
}
type ISmsProvider ¶
type IUserRepository ¶
type OtpBaseUserModel ¶
type OtpBaseUserModel struct {
Phone string `json:"phone"`
}
type OtpCheckerResponse ¶
type OtpCode ¶
type OtpCodeRepository ¶
type OtpCodeRepository struct { GormRepository OtpCode OtpCode }
Click to show internal directories.
Click to hide internal directories.