aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFChannel <>2022-06-04 17:40:24 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commite3c83c1ddaea5f42b6fda66d4b86459fd1349b3b (patch)
tree16108a76b3a868ba9e809c27eb95449e06a0df90
parent5ee6d0a7bb85d7f28fe4f838150c17ecb6a9d1b7 (diff)
logic corrections for instance creation, would return nil not complete steps
-rw-r--r--main.go8
-rw-r--r--util/verification.go10
2 files changed, 7 insertions, 11 deletions
diff --git a/main.go b/main.go
index aa2faf7..9ff4c54 100644
--- a/main.go
+++ b/main.go
@@ -122,6 +122,10 @@ func Init() {
config.Log.Println(err)
}
+ if err = db.InitInstance(); err != nil {
+ config.Log.Println(err)
+ }
+
if actor, err = activitypub.GetActorFromDB(config.Domain); err != nil {
config.Log.Println(err)
}
@@ -142,10 +146,6 @@ func Init() {
config.Log.Println(err)
}
- if err = db.InitInstance(); err != nil {
- config.Log.Println(err)
- }
-
go webfinger.StartupArchive()
go util.MakeCaptchas(100)
diff --git a/util/verification.go b/util/verification.go
index c64b54d..b5a44ff 100644
--- a/util/verification.go
+++ b/util/verification.go
@@ -71,17 +71,13 @@ func (verify Verify) CreateBoardMod() error {
query := `select code from verification where identifier=$1 and type=$2`
if err := config.DB.QueryRow(query, verify.Board, verify.Type).Scan(&code); err != nil {
- return nil
+ return MakeError(err, "CreateBoardMod")
}
var ident string
query = `select identifier from boardaccess where identifier=$1 and board=$2`
if err := config.DB.QueryRow(query, verify.Identifier, verify.Board).Scan(&ident); err != nil {
- return nil
- }
-
- if ident != verify.Identifier {
query := `insert into crossverification (verificationcode, code) values ($1, $2)`
if _, err := config.DB.Exec(query, code, pass); err != nil {
return MakeError(err, "CreateBoardMod")
@@ -91,10 +87,10 @@ func (verify Verify) CreateBoardMod() error {
if _, err = config.DB.Exec(query, verify.Identifier, pass, verify.Board, verify.Type); err != nil {
return MakeError(err, "CreateBoardMod")
}
-
- config.Log.Printf("Board access - Board: %s, Identifier: %s, Code: %s\n", verify.Board, verify.Identifier, pass)
}
+ config.Log.Printf("Board access - Board: %s, Identifier: %s, Code: %s\n", verify.Board, verify.Identifier, pass)
+
return nil
}