mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Prevent email verification from overriding existing sessions (#9075)
This commit is contained in:
parent
81653cf5fd
commit
e694e87814
@ -382,7 +382,8 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
const hasEmail = Boolean(this.state.formVals.email);
|
||||
const hasAccessToken = Boolean(response.access_token);
|
||||
debuglog("Registration: ui auth finished:", { hasEmail, hasAccessToken });
|
||||
if (!hasEmail && hasAccessToken) {
|
||||
// don’t log in if we found a session for a different user
|
||||
if (!hasEmail && hasAccessToken && !newState.differentLoggedInUserId) {
|
||||
// we'll only try logging in if we either have no email to verify at all or we're the client that verified
|
||||
// the email, not the client that started the registration flow
|
||||
await this.props.onLoggedIn({
|
||||
|
Loading…
Reference in New Issue
Block a user