feat: change user password
This commit is contained in:
@@ -16,14 +16,14 @@ type Config struct {
|
||||
}
|
||||
|
||||
func NewMux(cfg Config) http.Handler {
|
||||
userRepo := repository.NewUserRepo(cfg.Database)
|
||||
userService := domain.NewUserService(userRepo)
|
||||
userHandler := handler.NewUserHandler(userService)
|
||||
|
||||
authRepo := repository.NewAuthRepo(cfg.Database)
|
||||
authService := domain.NewAuthService(authRepo, []byte(cfg.JWTSecret))
|
||||
authHandler := handler.NewAuthHandler(authService)
|
||||
|
||||
userRepo := repository.NewUserRepo(cfg.Database)
|
||||
userService := domain.NewUserService(userRepo)
|
||||
userHandler := handler.NewUserHandler(userService, authService)
|
||||
|
||||
listRepo := repository.NewListRepo(cfg.Database)
|
||||
listService := domain.NewListService(listRepo)
|
||||
listHandler := handler.NewListHandler(listService, userService)
|
||||
@@ -40,6 +40,7 @@ func NewMux(cfg Config) http.Handler {
|
||||
apiMux.HandleFunc("POST /logout/all", authHandler.LogoutAllDevices)
|
||||
|
||||
apiMux.Handle("POST /users", protected(userHandler.CreateUser))
|
||||
apiMux.Handle("POST /users/password", protected(userHandler.ChangePassword))
|
||||
|
||||
apiMux.Handle("POST /lists", protected(listHandler.CreateList))
|
||||
apiMux.Handle("DELETE /lists/{id}", protected(listHandler.DeleteList))
|
||||
|
||||
Reference in New Issue
Block a user