def apiTemp_get(): if request.method == "POST": returnJson = userdb.get({ 'uuid': session["user"]["uuid"] if session["user"].has_key("uuid") else "" }) return jsonify(returnJson)
def apiTemp_login(): if request.method == "POST": formJson = request.get_json() print formJson returnJson = userdb.login({ 'loginID': escape(formJson["loginID"]), 'password': escape(formJson['password']) }) if returnJson.has_key("uuid"): session["user"] = userdb.get({"uuid": returnJson["uuid"]}).get("user", {}) return jsonify(returnJson)
def apiTemp_login(): if request.method == "POST": formJson = request.get_json() print formJson returnJson = userdb.login({ 'loginID': escape(formJson["loginID"]), 'password': escape(formJson['password']) }) if returnJson.has_key("uuid"): session["user"] = userdb.get({ "uuid": returnJson["uuid"] }).get("user", {}) return jsonify(returnJson)