From 981192ad69f6c46e043541e40cf8bf174562dec0 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Sun, 9 Mar 2025 12:57:41 +0700 Subject: [PATCH] Change the method for notme and verify --- handler.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/handler.py b/handler.py index 2e6889c..6a9b664 100644 --- a/handler.py +++ b/handler.py @@ -104,36 +104,32 @@ def index(): print(str(e),flush=True) return json.dumps({}, indent = 2).encode() -@app.route('/api/auth/notme', method='GET') +@app.route('/api/auth/notme', method=['OPTIONS', 'POST']) def index(): try: if request.method == 'OPTIONS': return None else: response.content_type = 'application/json' - params = { - "token" : request.query.token, - "mako" : { - "email" : template_email.main(directory.page["email"], "message") - } + params = request.json + params["mako" ] = { + "email" : template_email.main(directory.page["email"], "message") } return json.dumps(api_auth.auth().notme(params), indent = 2).encode() except Exception as e: print(str(e),flush=True) return json.dumps({}, indent = 2).encode() -@app.route('/api/auth/verify', method='GET') +@app.route('/api/auth/verify', method=['OPTIONS', 'POST']) def index(): try: if request.method == 'OPTIONS': return None else: response.content_type = 'application/json' - params = { - "token" : request.query.token, - "mako" : { - "email" : template_email.main(directory.page["email"], "message") - } + params = request.json + params["mako" ] = { + "email" : template_email.main(directory.page["email"], "message") } return json.dumps(api_auth.auth().verify(params), indent = 2).encode() except Exception as e: