Merge pull request #64 from KasperskyLab/main
Update of the dev branch with main (new) code
This commit is contained in:
commit
866f24bad8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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() {
|
||||
|
@ -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"})
|
||||
|
@ -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"])
|
||||
|
Loading…
Reference in New Issue
Block a user