Skip to content

Commit 7295239

Browse files
committed
ui: fix redirect to next on login
* redirect was borken after change to popup window * closes #2046 Signed-off-by: Pamfilos Fokianos <[email protected]>
1 parent 454125e commit 7295239

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ui/cap-react/src/components/settings/components/OAuthPopup.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import PropTypes from "prop-types";
55
export default class OauthPopup extends React.PureComponent {
66
constructor(props) {
77
super(props);
8+
const queryString = window.location.search;
9+
const urlParams = new URLSearchParams(queryString);
10+
811
window["loginCallBack"] = function() {
9-
if (props.loginCallBack) props.loginCallBack();
12+
if (props.loginCallBack) props.loginCallBack(urlParams.get('next'));
1013
return null;
1114
};
1215
}
@@ -34,3 +37,4 @@ OauthPopup.propTypes = {
3437
url: PropTypes.string,
3538
loginCallBack: PropTypes.func
3639
};
40+

ui/cap-react/src/components/welcome/Header.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@ class WelcomePage extends React.Component {
3737
};
3838
}
3939

40-
loginCallBack = () => {
41-
// const path = this.props.location.pathname;
42-
let {
43-
location: { state: { next: next = undefined } = {} }
44-
} = this.props.history;
40+
loginCallBack = (next) => {
4541
this.props.initCurrentUser(next);
4642
};
43+
4744
onFormSubmit = formData => {
4845
// fetch the next from history
4946
formData["next"] = this.state.next;

0 commit comments

Comments
 (0)