Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNS = errorx.NewNamespace("error.api.user") ErrNSSignIn = ErrNS.NewSubNamespace("signin") ErrSignInUnsupportedAuthType = ErrNSSignIn.NewType("unsupported_auth_type") ErrSignInOther = ErrNSSignIn.NewType("other") )
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(tidbForwarder *tidb.Forwarder) *AuthService
func (*AuthService) MWAuthRequired ¶
func (s *AuthService) MWAuthRequired() gin.HandlerFunc
MWAuthRequired creates a middleware that verifies the authentication token (JWT) in the request. If the token is valid, identity information will be attached in the context. If there is no authentication token, or the token is invalid, subsequent handlers will be skipped and errors will be generated.
func (*AuthService) Register ¶
func (s *AuthService) Register(r *gin.RouterGroup)
type TokenResponse ¶
Click to show internal directories.
Click to hide internal directories.