Don't check token length twice in Logout
This commit is contained in:
1 file changed
-4
@@ -9,10 +9,6 @@ import (
|
||||
|
||||
// /account/logout - log out of account
|
||||
func Logout(token []byte) error {
|
||||
if len(token) != TokenSize {
|
||||
return fmt.Errorf("invalid token")
|
||||
}
|
||||
|
||||
err := db.RemoveSessionFromToken(token)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
|
||||
Reference in new issue
Block a user