Skip to content

Commit ecd91a6

Browse files
author
Riolku
committed
security updates
1 parent 77cf2c9 commit ecd91a6

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

backend/cryptbox.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# uwsgi configuration file
2+
3+
[uwsgi]
4+
socket = /tmp/cryptbox.sock
5+
chown-socket = keenan:www-data
6+
chmod-socket = 660
7+
vacuum = true
8+
9+
uid = keenan
10+
chdir = /home/keenan/workspace/cryptbox/backend
11+
module = main:app
12+
master = true

backend/cryptbox/jwtutils/jwtutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ def verify_jwt(tkn, key):
99
raise InvalidJWT()
1010

1111
def make_jwt(payload, key):
12-
return jwt.encode(payload, key, algorithm = "HS256").decode("utf-8")
12+
return jwt.encode(payload, key, algorithm = "HS256")

backend/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def check_login():
3030

3131
@app.after_request
3232
def add_cookie(response):
33-
if g.user:
33+
if g.user and g.token:
3434
response.set_cookie("token", g.token, samesite = "None", secure = True)
3535
return response
3636

@@ -52,7 +52,7 @@ def catch_404(e):
5252
print(e)
5353
return {"status": "error", "code": 404}
5454

55-
@app.errorhandler(Exception)
55+
#@app.errorhandler(Exception)
5656
def catch_error(e):
5757
print(e)
5858
return {"status": "error", "code": 500, "details": str(e)}

frontend/package-lock.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)