diff options
| author | lonkaars <l.leblansch@gmail.com> | 2021-01-15 10:12:53 +0100 | 
|---|---|---|
| committer | lonkaars <l.leblansch@gmail.com> | 2021-01-15 10:12:53 +0100 | 
| commit | d7e6c155abc6ef8f0fa380b6af03da37602e7e40 (patch) | |
| tree | 07de2feaeb3f52590a3b4a06ca3e69c7e4f32a79 | |
| parent | 7281197838986467880d88d265de5c003efc8b6b (diff) | |
register set cookie instead of returning request
| -rw-r--r-- | api/auth/signup.py | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/api/auth/signup.py b/api/auth/signup.py index cca76b8..7007af7 100644 --- a/api/auth/signup.py +++ b/api/auth/signup.py @@ -1,4 +1,4 @@ -from flask import Blueprint, request +from flask import Blueprint, request, make_response  from main import cursor, connection  from randid import new_uuid  import auth.token as token @@ -37,4 +37,7 @@ def index():      new_token = token.generate_token()      token.add_token(user_id, token.hash_token(new_token)) -    return new_token, 200 +    res = make_response("", 200) +    res.set_cookie("token", new_token["token"], expires = int(new_token["expireDate"] / 1000)) + +    return res  |