Unverified Commit 7f6f00f6 authored by Mattermost Build's avatar Mattermost Build Committed by GitHub
Browse files

Automated cherry pick of #5927 (#5975)



* convey redirect link through verification

* reflect review comments

* Update components/do_verify_email/do_verify_email.tsx
Co-authored-by: default avatarIbrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
parent c97737eb
...@@ -55,7 +55,16 @@ export default class DoVerifyEmail extends React.PureComponent<Props, State> { ...@@ -55,7 +55,16 @@ export default class DoVerifyEmail extends React.PureComponent<Props, State> {
if (this.props.isLoggedIn) { if (this.props.isLoggedIn) {
GlobalActions.redirectUserToDefaultTeam(); GlobalActions.redirectUserToDefaultTeam();
} else { } else {
browserHistory.push('/login?extra=verified&email=' + encodeURIComponent((new URLSearchParams(this.props.location.search)).get('email') || '')); let link = '/login?extra=verified';
const email = (new URLSearchParams(this.props.location.search)).get('email');
if (email) {
link += '&email=' + encodeURIComponent(email);
}
const redirectTo = (new URLSearchParams(this.props.location.search)).get('redirect_to');
if (redirectTo) {
link += '&redirect_to=' + redirectTo;
}
browserHistory.push(link);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment