Add RedirectTo after login for Universal linking or deep linking to work (#6304)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
b28227ff6b
Коммит
554938a840
@@ -213,7 +213,7 @@ export default class LoginController extends React.Component {
|
||||
finishSignin(team) {
|
||||
const query = this.props.location.query;
|
||||
GlobalActions.loadCurrentLocale();
|
||||
if (query.redirect_to) {
|
||||
if (query.redirect_to && query.redirect_to.match(/^\//)) {
|
||||
browserHistory.push(query.redirect_to);
|
||||
} else if (team) {
|
||||
browserHistory.push(`/${team.name}`);
|
||||
|
||||
@@ -96,7 +96,7 @@ export default class Root extends React.Component {
|
||||
} else if (UserStore.getCurrentUser()) {
|
||||
GlobalActions.redirectUserToDefaultTeam();
|
||||
} else {
|
||||
browserHistory.push('/login');
|
||||
browserHistory.push('/login' + window.location.search);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ function preNeedsTeam(nextState, replace, callback) {
|
||||
const team = TeamStore.getByName(teamName);
|
||||
|
||||
if (!team) {
|
||||
browserHistory.push('/');
|
||||
browserHistory.push('/?redirect_to=' + encodeURIComponent(nextState.location.pathname));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user