session

package
v0.0.0-...-f06a132 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieKey = "session"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionHandler

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

func InitSessionHandler

func InitSessionHandler(sessionService *session.SessionService, config *config.Config, envVars *env.EnvVars) *SessionHandler

func (*SessionHandler) UserLogin

func (s *SessionHandler) UserLogin(c *gin.Context)

@Summary User login @Description Create login session for user @Tags session @Accept json @Param req body UserLoginRequest true "Email and password for authentication" @Produce json @Failure 403 {object} httpresp.StandardResponse "User is not verified" @Failure 401 {object} httpresp.StandardResponse "Authentication failed" @Success 200 {object} httpresp.StandardDataResponse{data=UserLoginResponse} @Router /session/login [post]

type UserLoginRequest

type UserLoginRequest struct {
	Email    string `json:"email" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type UserLoginResponse

type UserLoginResponse struct {
	Uuid   string `json:"uuid"`
	Expiry int64  `json:"expiry"`
}

Jump to

Keyboard shortcuts

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