diff options
Diffstat (limited to 'cmd/server')
-rw-r--r-- | cmd/server/main.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index a3d5124..035d00a 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -2,7 +2,7 @@ package main import ( "context" - "encoding/hex" + "encoding/base64" "errors" "net/http" "os" @@ -66,7 +66,7 @@ func main() { *schedulerCount = 1 } - hexKey, err := hex.DecodeString(*key) + baseKey, err := base64.StdEncoding.DecodeString(*key) if err != nil { panic("failed to decode key database: " + err.Error()) } @@ -84,7 +84,7 @@ func main() { // middleware var ( - authMiddleware = ext.NewAuthMiddleware(hexKey, logger.WithField("context", "auth")) + authMiddleware = ext.NewAuthMiddleware(baseKey, logger.WithField("context", "auth")) logMiddleware = ext.NewLogMiddleare(logger.WithField("context", "http")) initialMiddleware = ext.NewInitialSetupMiddleware(userRepository) ) @@ -99,7 +99,7 @@ func main() { // controller var ( - userController = service.NewAuthController(userRepository, userRepository, hexKey) + userController = service.NewAuthController(userRepository, userRepository, baseKey) fileSystemController = service.NewFileSystemController(fileSystemRepository, userRepository) ) |