added empty token check and copyright

This commit is contained in:
ston1th 2018-01-03 23:04:17 +01:00
commit 339d6de8bd
4 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,5 @@
// Copyright (C) 2018 Marius Schellenberger
package jwt
import (
@ -18,6 +20,10 @@ func TestValidate(t *testing.T) {
if err != nil {
t.Error(err)
}
_, err = DecodeToken("")
if err == nil {
t.Error(errors.New("token is empty"))
}
nt, err := DecodeToken(token.String())
if err != nil {
t.Error(err)