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() {
|
||||||
# Create desktop icon to lauch TinyCheck in a browser
|
# 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"
|
echo -e "\e[39m[+] Create Desktop icon under /home/${CURRENT_USER}/Desktop\e[39m"
|
||||||
cat >"/home/$CURRENT_USER/Desktop/tinycheck.desktop" <<EOL
|
cat >"/home/$CURRENT_USER/Desktop/tinycheck.desktop" <<EOL
|
||||||
#!/usr/bin/env xdg-open
|
#!/usr/bin/env xdg-open
|
||||||
@ -340,6 +341,7 @@ Name=TinyCheck
|
|||||||
Comment=Launcher for the TinyCheck frontend
|
Comment=Launcher for the TinyCheck frontend
|
||||||
Icon=/usr/share/tinycheck/app/frontend/src/assets/icon.png
|
Icon=/usr/share/tinycheck/app/frontend/src/assets/icon.png
|
||||||
EOL
|
EOL
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
cleaning() {
|
cleaning() {
|
||||||
|
@ -42,7 +42,7 @@ def require_header_token(f):
|
|||||||
def decorated(*args, **kwargs):
|
def decorated(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
token = request.headers['X-Token']
|
token = request.headers['X-Token']
|
||||||
jwt.decode(token, app.config["SECRET_KEY"])
|
jwt.decode(token, app.config["SECRET_KEY"], "HS256")
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
except:
|
except:
|
||||||
return jsonify({"message": "JWT verification failed"})
|
return jsonify({"message": "JWT verification failed"})
|
||||||
@ -58,7 +58,7 @@ def require_get_token(f):
|
|||||||
def decorated(*args, **kwargs):
|
def decorated(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
token = request.args.get("token")
|
token = request.args.get("token")
|
||||||
jwt.decode(token, app.config["SECRET_KEY"])
|
jwt.decode(token, app.config["SECRET_KEY"], "HS256")
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
except:
|
except:
|
||||||
return jsonify({"message": "JWT verification failed"})
|
return jsonify({"message": "JWT verification failed"})
|
||||||
|
@ -34,7 +34,7 @@ def get_token():
|
|||||||
"""
|
"""
|
||||||
token = jwt.encode({"exp": datetime.datetime.now() +
|
token = jwt.encode({"exp": datetime.datetime.now() +
|
||||||
datetime.timedelta(hours=24)}, app.config["SECRET_KEY"])
|
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"])
|
@app.route("/<p>/<path:path>", methods=["GET"])
|
||||||
|
Loading…
Reference in New Issue
Block a user