raise TokenInvalid exception when given token is nil