Simplify error return in GetUsernameFromToken

pull/1/head
maru 2023-12-29 14:38:12 -05:00
parent d533eeee5f
commit 575167f0f9
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D
1 changed files with 0 additions and 4 deletions

View File

@ -28,10 +28,6 @@ func GetUsernameFromToken(token []byte) (string, error) {
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)
if err != nil {
if err == sql.ErrNoRows {
return "", err
}
return "", err
}