Skip to content

Commit 98f9e6d

Browse files
committed
reference to plugin settings Kofi Verificatintoken fixed
1 parent d85e42e commit 98f9e6d

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/Kofi.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
from flask import Flask, request
2-
from datetime import datetime
31
from argparse import ArgumentParser
2+
from datetime import datetime
3+
import json
4+
import logging
5+
import os
6+
import signal
47
import subprocess
58
import sys
6-
import json
79
import time
810
import webbrowser
9-
import logging
11+
12+
from flask import Flask, request
13+
from pyngrok import ngrok
14+
from pyngrok.conf import PyngrokConfig
1015
import TouchPortalAPI as TP
1116
from TouchPortalAPI.logger import Logger
17+
1218
from TPPEntry import TP_PLUGIN_SETTINGS, PLUGIN_ID, TP_PLUGIN_INFO, __version__
1319
from createDefaultConfig import create_default_yaml_file
1420
from updateConfig import update_config_file
15-
import os
16-
import signal
17-
18-
from pyngrok import ngrok
19-
from pyngrok.conf import PyngrokConfig
2021

2122

2223
## • figure out how to set a static location for pyngrok to download the ngrok.exe file rather than it doing it every time?
@@ -60,7 +61,7 @@ def start_ngrok(self):
6061
try:
6162
# ngrok_command = "ngrok start --config=ngrok.yaml --all"
6263
# subprocess.Popen(ngrok_command, shell=True)
63-
g_log.info("Starting ngrok server...")
64+
# g_log.info("Starting ngrok server...")
6465
self.http_tunnel = ngrok.connect(name='TP_NGROK', pyngrok_config=self.ngrok_config)
6566
self.ngrok_running = True
6667
except Exception as e:
@@ -224,7 +225,8 @@ def formatTimestamp(self, timestamp:str):
224225
def webhook():
225226
if request.method == 'POST':
226227
data = json.loads(request.form['data'])
227-
if data['verification_token'] != TP_PLUGIN_SETTINGS['Kofi Verification Token']:
228+
if data['verification_token'] != TP_PLUGIN_SETTINGS['Kofi Verification Token']['value']:
229+
g_log.error("Verification token does not match.")
228230
return '', 403
229231

230232
KofiManager.process_webhook_data(data)

0 commit comments

Comments
 (0)