def create_user(self, args): node = self.nodes.find("User", args["username"]) if not node: passhash = Authenticate.hashgen(args["username"], args["password"]) properties = dict(node_id=args["username"], name=args["name"], city=args["city"], passhash=passhash) node = Node("User", **properties) self.graph.create(node) return node, True return node, False
def create_user(self, args): node = self.nodes.find("User", args["username"]) if not node: passhash = Authenticate.hashgen(args["username"], args["password"]) properties = dict( node_id=args["username"], name=args["name"], city=args["city"], passhash=passhash ) node = Node("User", **properties) self.graph.create(node) return node, True return node, False
def post_login(args): success, error = Authenticate.login(graph, session, args) return jsonify(success=success, error=error)