Explorar o código

Fixed fresh install panic issue

tobychui %!s(int64=2) %!d(string=hai) anos
pai
achega
7f8e5763d7
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      mod/auth/authlogger/authlogger.go

+ 2 - 0
mod/auth/authlogger/authlogger.go

@@ -5,6 +5,7 @@ import (
 	"errors"
 	"log"
 	"net/http"
+	"os"
 	"strconv"
 	"strings"
 	"time"
@@ -36,6 +37,7 @@ type LoginRecord struct {
 
 //New Logger create a new logger object
 func NewLogger() (*Logger, error) {
+	os.MkdirAll("./system/auth/", 0775)
 	db, err := database.NewDatabase("./system/auth/authlog.db", false)
 	if err != nil {
 		return nil, errors.New("*ERROR* Failed to create database for login tracking: " + err.Error())