|
@@ -39,11 +39,11 @@ type AuthEndpoints struct {
|
|
|
}
|
|
|
|
|
|
// Constructor
|
|
|
-func NewAuthenticationAgent(sessionName string, key []byte, sysdb *db.Database, allowReg bool, logger *logger.Logger, loginRedirectionHandler func(http.ResponseWriter, *http.Request)) *AuthAgent {
|
|
|
+func NewAuthenticationAgent(sessionName string, key []byte, sysdb *db.Database, allowReg bool, systemLogger *logger.Logger, loginRedirectionHandler func(http.ResponseWriter, *http.Request)) *AuthAgent {
|
|
|
store := sessions.NewCookieStore(key)
|
|
|
err := sysdb.NewTable("auth")
|
|
|
if err != nil {
|
|
|
- logger.Println("Failed to create auth database. Terminating.")
|
|
|
+ systemLogger.Println("Failed to create auth database. Terminating.")
|
|
|
panic(err)
|
|
|
}
|
|
|
|
|
@@ -53,6 +53,7 @@ func NewAuthenticationAgent(sessionName string, key []byte, sysdb *db.Database,
|
|
|
SessionStore: store,
|
|
|
Database: sysdb,
|
|
|
LoginRedirectionHandler: loginRedirectionHandler,
|
|
|
+ Logger: systemLogger,
|
|
|
}
|
|
|
|
|
|
//Return the authAgent
|