feat: return user id from login_refresh (#28905)
To enhance monitoring of login_refresh issues that happen in the frontend, return user id as part of successful refreshes.
This commit is contained in:
@@ -170,6 +170,7 @@ def get_response_with_refreshed_jwt_cookies(request, user):
|
||||
response.content = json.dumps(
|
||||
{
|
||||
'success': True,
|
||||
'user_id': user.id,
|
||||
'response_epoch_seconds': current_time,
|
||||
'response_http_date': http_date(current_time),
|
||||
'expires': expires_date if expires_date else 'not-found',
|
||||
|
||||
@@ -153,6 +153,8 @@ class CookieTests(TestCase):
|
||||
self._set_use_jwt_cookie_header(self.request)
|
||||
response = cookies_api.get_response_with_refreshed_jwt_cookies(self.request, self.user)
|
||||
data = json.loads(response.content.decode('utf8').replace("'", '"'))
|
||||
assert data['success'] is True
|
||||
assert data['user_id'] == self.user.id
|
||||
assert data['expires_epoch_seconds'] > 0
|
||||
assert data['expires'] != 'not-found'
|
||||
self._assert_cookies_present(response, cookies_api.JWT_COOKIE_NAMES)
|
||||
|
||||
Reference in New Issue
Block a user