Compare commits

..

No commits in common. "94d4e16cfdac394d33956c53f7021e7048dd281a" and "9dec6938dd2805c70af4362964775ec6818b53db" have entirely different histories.

2 changed files with 4 additions and 14 deletions

View file

@ -1,7 +1,7 @@
import psycopg2 import psycopg2
import os import os
import json import json
from flask import Flask, request, jsonify, render_template from flask import Flask, request, jsonify
config_dir_path = "./config/" config_dir_path = "./config/"
db_config_path = config_dir_path + "db.json" db_config_path = config_dir_path + "db.json"
@ -41,7 +41,7 @@ class Auth():
self.db.commit() self.db.commit()
app = Flask(__name__, static_folder="./resource/") app = Flask(__name__)
auth = Auth(db_config["host"], db_config["db"], db_config["port"], db_config["username"], db_config["password"]) auth = Auth(db_config["host"], db_config["db"], db_config["port"], db_config["username"], db_config["password"])
@app.route('/verify', methods=['POST']) @app.route('/verify', methods=['POST'])
@ -51,9 +51,9 @@ def verify():
if auth.check(pc_number, password) == 0: if auth.check(pc_number, password) == 0:
auth.delete(pc_number) auth.delete(pc_number)
return render_template("verify.html"), jsonify({'message': 'ok'}), 200 return jsonify({'message': 'ok'}), 200
else: else:
return render_template("verify.html"), jsonify({'message': 'damedesu'}), 401 return jsonify({'message': 'damedesu'}), 401
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run()

View file

@ -1,10 +0,0 @@
<html>
<head>
<title>Verify</title>
</head>
<body>
<h1>だめです</h1>
</body>
</html>