mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
0302-добавил куки и сломал десктоп авторизацию.
сложно поддерживать однояйцевых близнецов - desktop и TMA, подготовил к рефакторингу структуры
This commit is contained in:
@@ -135,7 +135,7 @@ func main() {
|
||||
settingsHandler := handlers.NewSettingsHandler(accountRepo, catalogRepo)
|
||||
settingsHandler.SetRMSFactory(rmsFactory)
|
||||
invoicesHandler := handlers.NewInvoiceHandler(invoicesService, syncService)
|
||||
authHandler := handlers.NewAuthHandler(authService, cfg.Telegram.BotUsername)
|
||||
authHandler := handlers.NewAuthHandler(authService, accountRepo, cfg.Telegram.BotUsername)
|
||||
|
||||
// 10. Telegram Bot (Передаем syncService и authService)
|
||||
if cfg.Telegram.Token != "" {
|
||||
@@ -176,8 +176,12 @@ func main() {
|
||||
|
||||
// Хендлер инициализации desktop авторизации (без middleware)
|
||||
api.POST("/auth/init-desktop", authHandler.InitDesktopAuth)
|
||||
// Новые endpoints для сессионной авторизации
|
||||
api.POST("/auth/session", authHandler.CreateSession)
|
||||
api.GET("/auth/me", authHandler.GetMe)
|
||||
api.POST("/auth/logout", authHandler.Logout)
|
||||
|
||||
api.Use(middleware.AuthMiddleware(accountRepo, cfg.Telegram.Token, cfg.Security.SecretKey, cfg.App.MaintenanceMode, cfg.App.DevIDs))
|
||||
api.Use(middleware.AuthMiddleware(accountRepo, authService, cfg.Telegram.Token, cfg.Security.SecretKey, cfg.App.MaintenanceMode, cfg.App.DevIDs))
|
||||
{
|
||||
// Drafts & Invoices
|
||||
api.GET("/drafts", draftsHandler.GetDrafts)
|
||||
|
||||
Reference in New Issue
Block a user