def register(self, user, password, _id): model = Models() if (model.check_username(user[0]) == True): return (jsonify(error="account already exists")) try: model.add_data(_id[0], user[0], password[0]) except Exception as e: print("Caught an exception : ", e) return (jsonify(error="internal error")) return (jsonify(result="account created"))
def signin(self, user, password): model = Models() try: if (model.check_username(user[0]) == True and model.check_password(password[0]) == True): return (jsonify(result="signin successful")) else: return (jsonify(error="login or password does not match")) except: return (jsonify(error="internal error"))