Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e694e87

Browse files
authored
Prevent email verification from overriding existing sessions (#9075)
1 parent 81653cf commit e694e87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/structures/auth/Registration.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ export default class Registration extends React.Component<IProps, IState> {
382382
const hasEmail = Boolean(this.state.formVals.email);
383383
const hasAccessToken = Boolean(response.access_token);
384384
debuglog("Registration: ui auth finished:", { hasEmail, hasAccessToken });
385-
if (!hasEmail && hasAccessToken) {
385+
// don’t log in if we found a session for a different user
386+
if (!hasEmail && hasAccessToken && !newState.differentLoggedInUserId) {
386387
// we'll only try logging in if we either have no email to verify at all or we're the client that verified
387388
// the email, not the client that started the registration flow
388389
await this.props.onLoggedIn({

0 commit comments

Comments
 (0)