forked from Ailur/burgernotes-server
Made migrations not kill the process
This commit is contained in:
parent
866f07825e
commit
9bd62dbf64
13
main.go
13
main.go
|
@ -473,10 +473,6 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if migrated == 0 {
|
|
||||||
c.JSON(401, gin.H{"error": "User has not migrated", "migrated": false})
|
|
||||||
}
|
|
||||||
|
|
||||||
_, _, hashedPasswd, err := getUser(userid)
|
_, _, hashedPasswd, err := getUser(userid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("[ERROR] Unknown in /api/login getUser():", err)
|
log.Println("[ERROR] Unknown in /api/login getUser():", err)
|
||||||
|
@ -496,8 +492,13 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !correctPassword {
|
if !correctPassword {
|
||||||
c.JSON(401, gin.H{"error": "Incorrect password", "migrated": true})
|
if migrated == 0 {
|
||||||
return
|
c.JSON(401, gin.H{"error": "User has not migrated", "migrated": false})
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
c.JSON(401, gin.H{"error": "Incorrect password", "migrated": true})
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
token, err := randomChars(512)
|
token, err := randomChars(512)
|
||||||
|
|
Loading…
Reference in New Issue