Change the method for notme and verify

This commit is contained in:
Dita Aji Pratama 2025-03-09 12:57:41 +07:00
parent 6fd96fd7ce
commit 981192ad69

View File

@ -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: