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

Commit

Permalink
Fix email registration: pt. 1
Browse files Browse the repository at this point in the history
We look to see if there's already a user logged in and if there is,
restore that session instead of logging the user in as their new
account. We still set this 'is_registered' flag though, even though
in that case it's not a newly registered account that's being restored,
so don't set in that case.
  • Loading branch information
dbkr committed May 14, 2019
1 parent 201fef8 commit a0ecd89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1710,9 +1710,6 @@ export default React.createClass({

// returns a promise which resolves to the new MatrixClient
onRegistered: function(credentials) {
// XXX: This should be in state or ideally store(s) because we risk not
// rendering the most up-to-date view of state otherwise.
this._is_registered = true;
if (this.state.register_session_id) {
// The user came in through an email validation link. To avoid overwriting
// their session, check to make sure the session isn't someone else.
Expand Down Expand Up @@ -1748,6 +1745,9 @@ export default React.createClass({
return MatrixClientPeg.get();
}
}
// XXX: This should be in state or ideally store(s) because we risk not
// rendering the most up-to-date view of state otherwise.
this._is_registered = true;
return Lifecycle.setLoggedIn(credentials);
},

Expand Down

0 comments on commit a0ecd89

Please sign in to comment.