From 43626ebec397bfc49a306a4162de6ff339b3dbf0 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Thu, 7 Aug 2025 10:53:52 +0700 Subject: [PATCH] put invite API in the handler --- handler.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/handler.py b/handler.py index 3974579..7eaf93d 100644 --- a/handler.py +++ b/handler.py @@ -216,6 +216,22 @@ def index(): except Exception as e: print(str(e),flush=True) return json.dumps({}, indent = 2).encode() + +@app.route('/api/auth/invite', method=['OPTIONS', 'POST']) +def index(): + try: + if request.method == 'OPTIONS': + return None + else: + response.content_type = 'application/json' + params = request.json + params["mako" ] = { + "email" : template_email.main(directory.page["email"], "accept") + } + return json.dumps(api_auth.auth().forgot(params), indent = 2).encode() + except Exception as e: + print(str(e),flush=True) + return json.dumps({}, indent = 2).encode() @app.route('/api/auth/login', method=['OPTIONS', 'POST']) def index():