Simplify error return in GetUsernameFromToken

pull/1/head
maru 11 months ago
parent d533eeee5f
commit 575167f0f9
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D

@ -28,10 +28,6 @@ func GetUsernameFromToken(token []byte) (string, error) {
var username string var username string
err := handle.QueryRow("SELECT a.username FROM accounts a JOIN sessions s ON s.uuid = a.uuid WHERE s.token = ? AND s.expire > UTC_TIMESTAMP()", token).Scan(&username) err := handle.QueryRow("SELECT a.username FROM accounts a JOIN sessions s ON s.uuid = a.uuid WHERE s.token = ? AND s.expire > UTC_TIMESTAMP()", token).Scan(&username)
if err != nil { if err != nil {
if err == sql.ErrNoRows {
return "", err
}
return "", err return "", err
} }

Loading…
Cancel
Save