mirror of https://github.com/vector-im/riot-web
Notify MatrixChat of teamToken after login
parent
fd3c1ab9e1
commit
e1a40a8ef0
|
@ -304,6 +304,10 @@ export function setLoggedIn(credentials) {
|
|||
rtsClient.login(credentials.userId).then((body) => {
|
||||
if (body.team_token) {
|
||||
localStorage.setItem("mx_team_token", body.team_token);
|
||||
dis.dispatch({
|
||||
action: 'set_team_token',
|
||||
value: body.team_token,
|
||||
})
|
||||
}
|
||||
}, (err) =>{
|
||||
console.error(
|
||||
|
|
|
@ -518,6 +518,9 @@ module.exports = React.createClass({
|
|||
case 'set_theme':
|
||||
this._onSetTheme(payload.value);
|
||||
break;
|
||||
case 'set_team_token':
|
||||
this._onSetTeamToken(payload.value);
|
||||
break;
|
||||
case 'on_logged_in':
|
||||
this._onLoggedIn();
|
||||
break;
|
||||
|
@ -692,6 +695,16 @@ module.exports = React.createClass({
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the team token is acquired at registration or login. This
|
||||
* should only happen if the configured RTS (see config.json teamServerURL)
|
||||
* recognises the user as having an email address that matches a team.
|
||||
*/
|
||||
_onSetTeamToken: function(teamToken) {
|
||||
this._teamToken = teamToken;
|
||||
this._setPage(PageTypes.HomePage);
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when a new logged in session has started
|
||||
*/
|
||||
|
@ -1003,8 +1016,7 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
onTeamMemberRegistered: function(teamToken) {
|
||||
this._teamToken = teamToken;
|
||||
this._setPage(PageTypes.HomePage);
|
||||
this._onSetTeamToken(teamToken);
|
||||
},
|
||||
|
||||
onFinishPostRegistration: function() {
|
||||
|
|
Loading…
Reference in New Issue