create_new_session(res, userId, jwtPayload = {}, sessionData = {})
Parameters
res
- type:
flask.Response
- type:
user_id
- type:
string
- description: Should be used to ID a user in your system.
- type:
jwt_pay_load
(Optional)- type:
dict
- description: This information is stored in the JWT sent to the frontend, so it should not contain any sensitive information.
- type:
session_data
(Optional)- type:
dict
- description: This information is stored only in your database, so it can contain sensitive information.
- type:
Returns
Session
on successful creation of a session. To know more about theSession
object, click here
Throws
Additional information
- Creates a new access, a new refresh and a new idRefresh token for this session. These are set in the cookies and header of the
res
object.