put invite API in the handler

This commit is contained in:
Dita Aji Pratama 2025-08-07 10:53:52 +07:00
parent b9d0f28a76
commit 43626ebec3

View File

@ -217,6 +217,22 @@ def index():
print(str(e),flush=True) print(str(e),flush=True)
return json.dumps({}, indent = 2).encode() 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']) @app.route('/api/auth/login', method=['OPTIONS', 'POST'])
def index(): def index():
try: try: