feat(verification): enforce user verification requirement for posts, comments, and WebSocket connections
Add verification status checks to protected routes including post creation, updates, deletion, likes, favorites, voting, and WebSocket connections. Also rename RequireVerification middleware to RequireVerified and update error response format with string error codes.
This commit is contained in:
@@ -5,6 +5,7 @@ package main
|
||||
|
||||
import (
|
||||
"carrot_bbs/internal/handler"
|
||||
"carrot_bbs/internal/repository"
|
||||
"carrot_bbs/internal/router"
|
||||
"carrot_bbs/internal/service"
|
||||
appwire "carrot_bbs/internal/wire"
|
||||
@@ -24,6 +25,7 @@ func InitializeApp() (*App, error) {
|
||||
|
||||
// ProvideRouter 提供路由
|
||||
func ProvideRouter(
|
||||
userRepo repository.UserRepository,
|
||||
userHandler *handler.UserHandler,
|
||||
postHandler *handler.PostHandler,
|
||||
commentHandler *handler.CommentHandler,
|
||||
@@ -58,6 +60,7 @@ func ProvideRouter(
|
||||
wsHandler *handler.WSHandler,
|
||||
) *router.Router {
|
||||
return router.New(
|
||||
userRepo,
|
||||
userHandler,
|
||||
postHandler,
|
||||
commentHandler,
|
||||
|
||||
Reference in New Issue
Block a user