aboutsummaryrefslogtreecommitdiff
path: root/api/auth
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-01-15 10:17:37 +0100
committerlonkaars <l.leblansch@gmail.com>2021-01-15 10:17:37 +0100
commitedcbbb61b8f6278404955d6758d4c1129f8dbc8a (patch)
tree9ab77dfa3eb29f8c6e04f9e4e7a4e651b1bb5b8b /api/auth
parent061ed07680d0e1f6feb89ad281e46cb321dce21c (diff)
token cookie in login
Diffstat (limited to 'api/auth')
-rw-r--r--api/auth/login.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/api/auth/login.py b/api/auth/login.py
index b01e057..5326b6f 100644
--- a/api/auth/login.py
+++ b/api/auth/login.py
@@ -28,4 +28,7 @@ def index():
new_token = token.generate_token()
token.add_token(user_id[0], token.hash_token(new_token))
- return new_token, 200
+ res = make_response("", 200)
+ res.set_cookie("token", new_token["token"], expires = int(new_token["expirationDate"] / 1000))
+
+ return res