This commit is contained in:
@@ -14,8 +14,8 @@ type Chat struct {
|
||||
cursor cursorCodec
|
||||
}
|
||||
|
||||
func NewChat(useCase UseCase) *Chat {
|
||||
return &Chat{useCase: useCase, cursor: newCursorCodec()}
|
||||
func NewChat(useCase UseCase, cursorKey [32]byte) *Chat {
|
||||
return &Chat{useCase: useCase, cursor: cursorCodec{secret: cursorKey}}
|
||||
}
|
||||
|
||||
func (h *Chat) Router() *echo.Echo {
|
||||
@@ -60,8 +60,11 @@ func (h *Chat) Router() *echo.Echo {
|
||||
e.GET("/swagger/*", swaggerUI)
|
||||
e.POST("/api/v1/users", h.createUser)
|
||||
|
||||
e.POST("/api/v1/auth/sessions", h.createSession)
|
||||
|
||||
api := e.Group("/api/v1", h.authenticate)
|
||||
api.GET("/users/me", h.currentUser)
|
||||
api.DELETE("/auth/sessions/current", h.deleteSession)
|
||||
api.POST("/chats", h.createChat)
|
||||
api.GET("/chats", h.listChats)
|
||||
api.GET("/chats/:chat_id", h.getChat)
|
||||
|
||||
Reference in New Issue
Block a user