- const loadMainApp = this.props.loadMainApp;
- this.props.dispatch<any>(saveApiToken(apiToken)).finally(() => {
- if (loadMainApp) {
- if (this.props.dispatch(getAccountLinkData())) {
- this.props.dispatch(navigateToLinkAccount);
- }
- else {
- this.props.dispatch(navigateToRootProject);
- }
+ this.props.dispatch<any>(saveApiToken(apiToken));
+ }
+
+ componentDidUpdate() {
+ const redirectURL = this.props.authService.getTargetURL();
+
+ if (this.props.loadMainApp && this.props.user) {
+ if (redirectURL) {
+ this.props.authService.removeTargetURL();
+ this.props.dispatch(replace(redirectURL));