Encrypt TOTP secret before saving to database

This commit is contained in:
2024-10-31 16:24:32 +07:00
parent f705d9538f
commit 197383c414
21 changed files with 271 additions and 172 deletions

View File

@ -12,24 +12,26 @@ var Admin App
type App struct {
http.Server
Database types.Database
Cache types.CachingServer
Storage types.Storage
Logger *logger.AggregatedLogger
Mail *email.SmtpServer
Database types.Database
Cache types.CachingServer
Storage types.Storage
Encryption types.Encryption
Logger *logger.AggregatedLogger
Mail *email.SmtpServer
}
func NewClientServer(addr string, handler http.Handler, logger logger.AggregatedLogger, database types.Database, cache types.CachingServer, storage types.Storage, mail email.SmtpServer) App {
func NewClientServer(addr string, handler http.Handler, logger logger.AggregatedLogger, database types.Database, cache types.CachingServer, encryption types.Encryption, storage types.Storage, mail email.SmtpServer) App {
return App{
Server: http.Server{
Addr: addr,
Handler: handler,
},
Storage: storage,
Logger: &logger,
Database: database,
Cache: cache,
Mail: &mail,
Storage: storage,
Logger: &logger,
Database: database,
Encryption: encryption,
Cache: cache,
Mail: &mail,
}
}