This should do it
This commit is contained in:
parent
97cd88d02b
commit
1308027c34
|
@ -13,7 +13,6 @@ import (
|
|||
"time"
|
||||
|
||||
"./common"
|
||||
"./config"
|
||||
"./install/install"
|
||||
"./query_gen/lib"
|
||||
"./routes"
|
||||
|
@ -53,10 +52,15 @@ func gloinit() (err error) {
|
|||
//nogrouplog = true
|
||||
common.StartTime = time.Now()
|
||||
|
||||
err = common.LoadConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = common.ProcessConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
common.Themes, err = common.NewThemeList()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -92,7 +96,6 @@ func gloinit() (err error) {
|
|||
}
|
||||
|
||||
func init() {
|
||||
config.Config()
|
||||
err := gloinit()
|
||||
if err != nil {
|
||||
log.Print("Something bad happened")
|
||||
|
|
|
@ -883,18 +883,18 @@ func TestAuth(t *testing.T) {
|
|||
passwordTest(t, realPassword, hashedPassword2)
|
||||
// TODO: Peek at the prefix to verify this is a bcrypt hash
|
||||
|
||||
_, err = common.Auth.Authenticate("None", "password")
|
||||
_, err, _ = common.Auth.Authenticate("None", "password")
|
||||
errmsg := "Username None shouldn't exist"
|
||||
if err != nil {
|
||||
errmsg += "\n" + err.Error()
|
||||
}
|
||||
expect(t, err == common.ErrNoUserByName, errmsg)
|
||||
|
||||
uid, err := common.Auth.Authenticate("Admin", "password")
|
||||
uid, err, _ := common.Auth.Authenticate("Admin", "password")
|
||||
expectNilErr(t, err)
|
||||
expect(t, uid == 1, fmt.Sprintf("Default admin uid should be 1 not %d", uid))
|
||||
|
||||
_, err = common.Auth.Authenticate("Sam", "ReallyBadPassword")
|
||||
_, err, _ = common.Auth.Authenticate("Sam", "ReallyBadPassword")
|
||||
errmsg = "Username Sam shouldn't exist"
|
||||
if err != nil {
|
||||
errmsg += "\n" + err.Error()
|
||||
|
|
Loading…
Reference in New Issue