Don't restore session unless crypto data is found
Add a check to ensure that we find crypto data in the crypto store when we're restoring a session and otherwise abort the session restore. This will prevent us from restoring a session and generating new keys when there was a previous session with different keys. ***This will force a logout for all users*** See the linked issue (and the comment in code) for more detail. Fixes https://github.com/vector-im/element-call/issues/464
This commit is contained in:
@@ -101,12 +101,15 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
||||
const { user_id, device_id, access_token, passwordlessUser } =
|
||||
session;
|
||||
|
||||
const client = await initClient({
|
||||
baseUrl: defaultHomeserver,
|
||||
accessToken: access_token,
|
||||
userId: user_id,
|
||||
deviceId: device_id,
|
||||
});
|
||||
const client = await initClient(
|
||||
{
|
||||
baseUrl: defaultHomeserver,
|
||||
accessToken: access_token,
|
||||
userId: user_id,
|
||||
deviceId: device_id,
|
||||
},
|
||||
true
|
||||
);
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
return { client, isPasswordlessUser: passwordlessUser };
|
||||
|
||||
Reference in New Issue
Block a user