Some whitespace fixes
This commit is contained in:
parent
6352f752ca
commit
a409231ca0
|
@ -112,8 +112,8 @@ func TokenNewPOST(md common.MethodData) common.CodeMessager {
|
||||||
tokenStr = common.RandomString(32)
|
tokenStr = common.RandomString(32)
|
||||||
tokenMD5 = fmt.Sprintf("%x", md5.Sum([]byte(tokenStr)))
|
tokenMD5 = fmt.Sprintf("%x", md5.Sum([]byte(tokenStr)))
|
||||||
r.Token = tokenStr
|
r.Token = tokenStr
|
||||||
var id int
|
|
||||||
|
|
||||||
|
var id int
|
||||||
err := md.DB.QueryRow("SELECT id FROM tokens WHERE token=? LIMIT 1", tokenMD5).Scan(&id)
|
err := md.DB.QueryRow("SELECT id FROM tokens WHERE token=? LIMIT 1", tokenMD5).Scan(&id)
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
break
|
break
|
||||||
|
@ -229,7 +229,7 @@ func fixPrivileges(user int, db *sqlx.DB) {
|
||||||
}
|
}
|
||||||
rows, err := db.Query(`
|
rows, err := db.Query(`
|
||||||
SELECT
|
SELECT
|
||||||
tokens.id, tokens.privileges, users.privileges
|
tokens.id, tokens.privileges, users.privileges
|
||||||
FROM tokens
|
FROM tokens
|
||||||
LEFT JOIN users ON users.id = tokens.user
|
LEFT JOIN users ON users.id = tokens.user
|
||||||
`+wc, params...)
|
`+wc, params...)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user