Merge pull request #64 from KasperskyLab/main

Update of the dev branch with main (new) code
This commit is contained in:
Félix Aimé 2021-03-25 10:30:16 +01:00 committed by GitHub
commit 866f24bad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -327,6 +327,7 @@ compile_vuejs() {
create_desktop() {
# Create desktop icon to lauch TinyCheck in a browser
if [[ -d "/home/$CURRENT_USER/Desktop/" ]]; then
echo -e "\e[39m[+] Create Desktop icon under /home/${CURRENT_USER}/Desktop\e[39m"
cat >"/home/$CURRENT_USER/Desktop/tinycheck.desktop" <<EOL
#!/usr/bin/env xdg-open
@ -340,6 +341,7 @@ Name=TinyCheck
Comment=Launcher for the TinyCheck frontend
Icon=/usr/share/tinycheck/app/frontend/src/assets/icon.png
EOL
fi
}
cleaning() {

View File

@ -42,7 +42,7 @@ def require_header_token(f):
def decorated(*args, **kwargs):
try:
token = request.headers['X-Token']
jwt.decode(token, app.config["SECRET_KEY"])
jwt.decode(token, app.config["SECRET_KEY"], "HS256")
return f(*args, **kwargs)
except:
return jsonify({"message": "JWT verification failed"})
@ -58,7 +58,7 @@ def require_get_token(f):
def decorated(*args, **kwargs):
try:
token = request.args.get("token")
jwt.decode(token, app.config["SECRET_KEY"])
jwt.decode(token, app.config["SECRET_KEY"], "HS256")
return f(*args, **kwargs)
except:
return jsonify({"message": "JWT verification failed"})

View File

@ -34,7 +34,7 @@ def get_token():
"""
token = jwt.encode({"exp": datetime.datetime.now() +
datetime.timedelta(hours=24)}, app.config["SECRET_KEY"])
return jsonify({"token": token.decode("utf8")})
return jsonify({"token": token})
@app.route("/<p>/<path:path>", methods=["GET"])