From db3b7f577ab490e051e653141773a4ab7561df81 Mon Sep 17 00:00:00 2001
From: Simone Margaritelli <evilsocket@gmail.com>
Date: Mon, 7 Oct 2019 15:45:11 +0200
Subject: [PATCH] misc: small fix or general refactoring i did not bother
 commenting

---
 pwnagotchi/plugins/default/api.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pwnagotchi/plugins/default/api.py b/pwnagotchi/plugins/default/api.py
index 71d78e3..f906b06 100644
--- a/pwnagotchi/plugins/default/api.py
+++ b/pwnagotchi/plugins/default/api.py
@@ -112,6 +112,7 @@ def parse_pcap(filename):
 
 def api_report_ap(log, keys, token, essid, bssid):
     while True:
+        token = AUTH.data['token']
         logging.info("api: reporting %s (%s)" % (essid, bssid))
         try:
             api_address = 'https://api.pwnagotchi.ai/api/v1/unit/report/ap'