Fix SSO login with subpaths (#4496)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
parent
a968db07f7
commit
a9e56cb315
1 changed files with 9 additions and 8 deletions
|
|
@ -109,7 +109,15 @@ class SSO extends PureComponent {
|
|||
}
|
||||
|
||||
extractCookie = (parsedUrl) => {
|
||||
CookieManager.get(parsedUrl.origin, true).then((res) => {
|
||||
const original = urlParse(this.props.serverUrl);
|
||||
|
||||
// Check whether we need to set a sub-path
|
||||
parsedUrl.set('pathname', original.pathname || '');
|
||||
|
||||
parsedUrl.set('query', '');
|
||||
Client4.setUrl(parsedUrl.href);
|
||||
|
||||
CookieManager.get(parsedUrl.href, true).then((res) => {
|
||||
const mmtoken = res.MMAUTHTOKEN;
|
||||
const token = typeof mmtoken === 'object' ? mmtoken.value : mmtoken;
|
||||
|
||||
|
|
@ -121,13 +129,6 @@ class SSO extends PureComponent {
|
|||
} = this.props.actions;
|
||||
|
||||
Client4.setToken(token);
|
||||
if (this.props.serverUrl !== parsedUrl.origin) {
|
||||
const original = urlParse(this.props.serverUrl);
|
||||
|
||||
// Check whether we need to set a sub-path
|
||||
parsedUrl.set('pathname', original.pathname || '');
|
||||
Client4.setUrl(parsedUrl.href);
|
||||
}
|
||||
ssoLogin(token).then((result) => {
|
||||
if (result.error) {
|
||||
this.onLoadEndError(result.error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue