mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Implement access token expiry (#5660)
Record how long an access token is valid for, and raise a soft-logout once it expires.
This commit is contained in:
parent
24aa0e0a5b
commit
5f158ec039
14 changed files with 255 additions and 33 deletions
|
@ -262,9 +262,11 @@ class AuthTestCase(unittest.TestCase):
|
|||
self.store.add_access_token_to_user = Mock()
|
||||
|
||||
token = yield self.hs.handlers.auth_handler.get_access_token_for_user_id(
|
||||
USER_ID, "DEVICE"
|
||||
USER_ID, "DEVICE", valid_until_ms=None
|
||||
)
|
||||
self.store.add_access_token_to_user.assert_called_with(
|
||||
USER_ID, token, "DEVICE", None
|
||||
)
|
||||
self.store.add_access_token_to_user.assert_called_with(USER_ID, token, "DEVICE")
|
||||
|
||||
def get_user(tok):
|
||||
if token != tok:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue