Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResult ¶
type AuthResult struct {
Token string `json:"token"`
ExpiresAt time.Time `json:"expires_at"`
User *UserInfo `json:"user"`
}
AuthResult is the result of a successful authentication.
type AuthService ¶
type AuthService interface {
GetLoginURL(state string) string
GetSignupURL() string
GetLogoutURL(casdoorAccessToken string) string
HandleCallback(code string) (*AuthResult, error)
GenerateState() string
Logout(ctx context.Context, userID string) error
GetCasdoorToken(ctx context.Context, userID string) (string, error)
}
AuthService is the authentication service interface.
func NewAuthService ¶
func NewAuthService(casdoorClient *casdoor.Client, jwtConfig *config.JWTConfig, sessionService session.SessionService) (AuthService, error)
NewAuthService creates an authentication service.
Click to show internal directories.
Click to hide internal directories.