fix: create RandomGenerator interface and struct for testing purpose #181

This commit is contained in:
2024-10-05 13:49:43 +02:00
parent d36f880a01
commit 6b033e2c2e
6 changed files with 125 additions and 55 deletions

View File

@@ -15,8 +15,9 @@ func GetHandler(d *sql.DB, serverSettings *types.ServerSettings) http.Handler {
router.HandleFunc("/", service.HandleIndexAnd404(d, serverSettings))
randomGenerator := service.NewRandomGeneratorImpl()
dbAuth := db.NewDbAuthSqlite(d)
serviceAuth := service.NewServiceAuthImpl(dbAuth, serverSettings)
serviceAuth := service.NewServiceAuthImpl(dbAuth, randomGenerator, serverSettings)
handlerAuth := NewHandlerAuth(d, serviceAuth, serverSettings)
// Serve static files (CSS, JS and images)