You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-06-27 15:01:53 +03:00
Merge pull request #685 from matrix-org/luke/rts-session-team-token
Persist query parameter team token across refreshes
This commit is contained in:
@ -191,10 +191,19 @@ module.exports = React.createClass({
|
||||
MatrixClientPeg.opts.initialSyncLimit = this.props.config.sync_timeline_limit;
|
||||
}
|
||||
|
||||
// Persist the team token across refreshes using sessionStorage. A new window or
|
||||
// tab will not persist sessionStorage, but refreshes will.
|
||||
if (this.props.startingFragmentQueryParams.team_token) {
|
||||
window.sessionStorage.setItem(
|
||||
'mx_team_token',
|
||||
this.props.startingFragmentQueryParams.team_token,
|
||||
);
|
||||
}
|
||||
|
||||
// Use the locally-stored team token first, then as a fall-back, check to see if
|
||||
// a referral link was used, which will contain a query parameter `team_token`.
|
||||
this._teamToken = window.localStorage.getItem('mx_team_token') ||
|
||||
this.props.startingFragmentQueryParams.team_token;
|
||||
window.sessionStorage.getItem('mx_team_token');
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
|
Reference in New Issue
Block a user