Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
type AuthResponse struct {
User *user.User `json:"user"`
Session *session.Session `json:"session"`
Token string `json:"token"`
RequireTwoFA bool `json:"requireTwofa,omitempty"`
}
AuthResponse represents a successful authentication response with user, session, and token
type ErrorResponse ¶
type ErrorResponse = errs.AuthsomeError
ErrorResponse is an alias to errs.AuthsomeError for consistency across the codebase. Instead of using &ErrorResponse{Error: "message"}, use the errs package constructors:
- errs.New(code, message, httpStatus)
- errs.BadRequest(message)
- errs.Unauthorized()
- errs.NotFound(message)
- etc.
See internal/errs/errors.go for all available error constructors.
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
MessageResponse represents a simple message response
type SessionResponse ¶
type SessionResponse struct {
User *user.User `json:"user"`
Session *session.Session `json:"session"`
}
SessionResponse represents a session query response
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status"`
}
StatusResponse represents a status response
type SuccessResponse ¶
type SuccessResponse struct {
Success bool `json:"success"`
}
SuccessResponse represents a success boolean response
type TwoFARequiredResponse ¶
type TwoFARequiredResponse struct {
User *user.User `json:"user"`
RequireTwoFA bool `json:"requireTwofa"`
DeviceID string `json:"deviceId,omitempty"`
}
TwoFARequiredResponse indicates that two-factor authentication is required
type VerifyResponse ¶
type VerifyResponse struct {
User interface{} `json:"user"`
Session interface{} `json:"session"`
Token string `json:"token"`
}
VerifyResponse represents a verification response (used by emailotp, magiclink, phone plugins) Uses interface{} for flexibility across different plugin implementations