Commit graph

47 commits

Author SHA1 Message Date
Travis Ralston
839593412c
Support refresh tokens (#7802)
MSC: https://github.com/matrix-org/matrix-doc/pull/2918
Fixes https://github.com/vector-im/element-web/issues/18698
Fixes https://github.com/vector-im/element-web/issues/20648
**Requires https://github.com/matrix-org/matrix-js-sdk/pull/2178**

**Note**: There's a lot of logging in this PR. That is intentional to ensure that if/when something goes wrong we can chase the exact code path. It does not log any tokens - just where the code is going. Overall, it should be fairly low volume spam (and can be relaxed at a later date).

----

This approach uses indexeddb (through a mutex library) to manage which tab actually triggers the refresh, preventing issues where multiple tabs try to update the token. If multiple tabs update the token then the server might consider the account hacked and hard logout all the tokens.

If for some reason the timer code gets it wrong, or the user has been offline for too long and the token can't be refreshed, they should be sent to a soft logout screen by the server. This will retain the user's encryption state - they simply need to reauthenticate to get an active access token again.

This additionally contains a change to fix soft logout not working, per the issue links above.

Of interest may be the IPC approach which was ultimately declined in favour of this change instead: https://github.com/matrix-org/matrix-react-sdk/pull/7803
2022-02-15 20:16:49 +00:00
Aaron Raimist
7b94e13a84 Merge branch 'develop' into sort-imports
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-12-09 08:34:20 +00:00
Michael Telatynski
aa7cae08aa
Add utility method mxLoginWithAccessToken to login with existing access token (#7261) 2021-12-02 13:46:44 +00:00
Aaron Raimist
bdc56be863
Auto fix
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-10-22 17:23:37 -05:00
Germain
e20ac7bf1e
Implement deep-linking for threads (matrix.to) (#7003) 2021-10-22 09:30:36 +01:00
Dariusz Niemczyk
5290afcc4c Replace console.warn with logger.warn
Related https://github.com/vector-im/element-web/issues/18425
2021-10-18 14:08:23 +02:00
Dariusz Niemczyk
5e73a212f4 Replace console.error with logger.error
Related https://github.com/vector-im/element-web/issues/18425
2021-10-18 14:08:23 +02:00
Dariusz Niemczyk
2d1d42b90e
Globally replace all console.logs via codemod (#6827)
This commit replaces all the `console.log` to `logger.log` via an automated script.
Related: vector-im/element-web#18425
2021-09-21 09:48:09 -06:00
Germain Souquet
54a0a869bf PR feedback 2021-08-24 09:09:28 +01:00
Germain Souquet
ac0412d238 rename feature flag for Threads 2021-08-19 12:25:29 +01:00
Michael Telatynski
ce78cdf4ad Conform to new react and typescript eslint rules 2021-07-19 22:43:11 +01:00
Michael Telatynski
d737b4e6ab Use webpack worker-loader to load the IndexedDB worker instead of homegrown hack 2021-07-12 18:43:20 +01:00
Michael Telatynski
bd175c6f40 Improve and consolidate typing 2021-07-10 15:43:46 +01:00
Šimon Brandner
dcb5557848
Revert some changes due to failing tests
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-02 18:00:07 +02:00
Šimon Brandner
426c79f47d
Delint
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-02 17:25:30 +02:00
Šimon Brandner
a4fe2f143f
First batch of burning
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-02 12:12:41 +02:00
J. Ryan Stinnett
ae0a8b8da4 Auto-fix lint errors 2021-06-29 13:11:58 +01:00
Hubert Chathi
d5b115dd08 don't overwrite callback with undefined if no customization provided 2021-03-22 19:52:09 -04:00
Timo Kösters
f575625c7a
fix: make room directory correct when using a homeserver with explicit port
Server names are allowed to contain ':' to specify a port, see https://matrix.org/docs/spec/appendices#server-name
User ids on the other hand are not allowed to contain ':', even
historical user ids, see https://matrix.org/docs/spec/appendices#historical-user-ids

Therefore we can use change the regex to make sure the localpart is not
allowed to contain ':'.
2021-03-15 23:13:16 +01:00
David Baker
bb6659f983 Set ICE candidate pool size option
So we can start candidate gathering in advance
2021-02-16 15:48:58 +00:00
Bruno Windels
067b4ca93e
Merge pull request #5397 from matrix-org/bwindels/customise-dehydration-key
Add customisation point for dehydration key
2020-11-04 17:25:52 +00:00
Bruno Windels
f3743f3ca1 fix spelling 2020-11-04 16:53:58 +01:00
Bruno Windels
625e03cde3 allow customising the source of dehydration key 2020-11-04 16:51:45 +01:00
Michael Telatynski
0c14de3017 defer some toasts 2020-11-02 17:25:48 +00:00
J. Ryan Stinnett
2698a12a6f Convert src/SecurityManager.js to TypeScript
This includes a few small API tweaks as well, only in cases where TS revealed we
were doing something confusing or wrong.

Part of https://github.com/vector-im/element-web/issues/15350
2020-10-09 17:27:03 +01:00
J. Ryan Stinnett
1b255e42c3 Convert src/Lifecycle.ts to TypeScript 2020-10-07 12:53:59 +01:00
J. Ryan Stinnett
11eb9b59e6 Convert src/Login.js to TypeScript 2020-10-07 11:47:27 +01:00
Hubert Chathi
503f32948c try to unlock secret storage with dehydration key 2020-10-01 21:40:49 -04:00
Hubert Chathi
744f46417a update to latest js-sdk changes 2020-09-30 00:52:47 -04:00
Hubert Chathi
4e2397a79d doc fixes and minor code improvement 2020-09-18 20:53:39 -04:00
Hubert Chathi
add36ca4ce Merge branch 'develop' into dehydration 2020-09-18 18:00:41 -04:00
Hubert Chathi
4398f1eb94 support setting up dehydration from blank account, SSO support, and other fixes 2020-09-03 16:28:42 -04:00
J. Ryan Stinnett
fb2bde94fa Rename CrossSigningManager to SecurityManager
The file encompasses bits of cross-signing and also secret storage / secure
backup.
2020-09-03 14:50:49 +01:00
Hubert Chathi
1c2e05e925 initial version of device rehydration support 2020-08-31 14:40:16 -04:00
Travis Ralston
9c8682428f Fix various TypeScript linting issues 2020-07-29 11:03:43 -06:00
Jorik Schellekens
05d0309081 Lint a few semicolons 2020-06-18 14:32:43 +01:00
Michael Telatynski
5156388fc6 Change well known poll period to 2 hours to match existing Jitsi poll
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-03 12:25:57 +01:00
Michael Telatynski
cbc2aee746 Add js-sdk mechanism for polling client well-known for config
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-01 22:35:16 +01:00
Hubert Chathi
dc4a2191c1 really fix types 2020-05-28 12:04:32 -04:00
Hubert Chathi
0859827910 fix types 2020-05-28 11:56:48 -04:00
Hubert Chathi
30120dc0c7 Merge remote-tracking branch 'upstream/develop' into keytar 2020-05-28 11:15:36 -04:00
Michael Telatynski
0713139dc5 Merge branches 'develop' and 't3chguy/confusing_copy' of github.com:matrix-org/matrix-react-sdk into t3chguy/confusing_copy 2020-05-26 13:35:18 +01:00
Travis Ralston
1c9b5eb42d Appease the tests 2020-05-25 16:14:51 -06:00
Travis Ralston
e5c2d17015 Move the instance definition to the Window 2020-05-25 16:06:05 -06:00
Travis Ralston
0cec74cc2b Appease the linter (and the project)
Also export the interface that the project expects to be able to import :|
2020-05-25 15:59:15 -06:00
Travis Ralston
bd2d13edd2 Convert the MatrixClientPeg to TypeScript 2020-05-25 15:52:05 -06:00
Travis Ralston
982e81f9a3 Rename MatrixClientPeg to ts 2020-05-25 15:43:21 -06:00
Renamed from src/MatrixClientPeg.js (Browse further)