diff --git a/dislocker_auth.py b/dislocker_auth.py index 0644e5a..0f28ec4 100644 --- a/dislocker_auth.py +++ b/dislocker_auth.py @@ -1,7 +1,7 @@ import psycopg2 import os import json -from flask import Flask, request, jsonify +from flask import Flask, request, jsonify, render_template config_dir_path = "./config/" db_config_path = config_dir_path + "db.json" @@ -41,7 +41,7 @@ class Auth(): self.db.commit() -app = Flask(__name__) +app = Flask(__name__, static_folder="./resource/") auth = Auth(db_config["host"], db_config["db"], db_config["port"], db_config["username"], db_config["password"]) @app.route('/verify', methods=['POST']) @@ -51,9 +51,9 @@ def verify(): if auth.check(pc_number, password) == 0: auth.delete(pc_number) - return jsonify({'message': 'ok'}), 200 + return render_template("verify.html"), jsonify({'message': 'ok'}), 200 else: - return jsonify({'message': 'damedesu'}), 401 + return render_template("verify.html"), jsonify({'message': 'damedesu'}), 401 if __name__ == '__main__': app.run() \ No newline at end of file