handlers

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message,omitempty"`
}

ErrorResponse represents an error response

type Handlers

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

Handlers provides pre-built HTTP handlers for authentication

func NewHandlers

func NewHandlers(service *auth.Service, routeConfig *config.RouteConfig) *Handlers

NewHandlers creates a new Handlers instance

func (*Handlers) ChangePassword

func (h *Handlers) ChangePassword(w http.ResponseWriter, r *http.Request)

ChangePassword handles changing user password (requires authentication)

func (*Handlers) GoogleOAuthCallback

func (h *Handlers) GoogleOAuthCallback(w http.ResponseWriter, r *http.Request)

GoogleOAuthCallback handles the Google OAuth callback

func (*Handlers) GoogleOAuthLogin

func (h *Handlers) GoogleOAuthLogin(w http.ResponseWriter, r *http.Request)

GoogleOAuthLogin initiates Google OAuth login flow

func (*Handlers) Login

func (h *Handlers) Login(w http.ResponseWriter, r *http.Request)

Login handles user authentication

func (*Handlers) Logout

func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request)

Logout handles user logout (requires authentication)

func (*Handlers) Profile

func (h *Handlers) Profile(w http.ResponseWriter, r *http.Request)

Profile handles retrieving user profile (requires authentication)

func (*Handlers) RefreshToken

func (h *Handlers) RefreshToken(w http.ResponseWriter, r *http.Request)

RefreshToken handles token refresh

func (*Handlers) Register

func (h *Handlers) Register(w http.ResponseWriter, r *http.Request)

Register handles user registration

func (*Handlers) RegisterRoutes

func (h *Handlers) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers all authentication routes on the provided mux

func (*Handlers) RequestPasswordReset

func (h *Handlers) RequestPasswordReset(w http.ResponseWriter, r *http.Request)

RequestPasswordReset handles password reset requests

func (*Handlers) ResendVerification

func (h *Handlers) ResendVerification(w http.ResponseWriter, r *http.Request)

ResendVerification handles resending verification email (requires authentication)

func (*Handlers) ResetPassword

func (h *Handlers) ResetPassword(w http.ResponseWriter, r *http.Request)

ResetPassword handles password reset with token

func (*Handlers) UnlinkGoogleOAuth

func (h *Handlers) UnlinkGoogleOAuth(w http.ResponseWriter, r *http.Request)

UnlinkGoogleOAuth handles unlinking a Google OAuth account (requires authentication)

func (*Handlers) VerifyEmail

func (h *Handlers) VerifyEmail(w http.ResponseWriter, r *http.Request)

VerifyEmail handles email verification

type SuccessResponse

type SuccessResponse struct {
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

SuccessResponse represents a success response

Jump to

Keyboard shortcuts

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