[FIX] Custom OAuth URL (#1172)

* Fix custom oauth url.

* Removes console.log(...)
This commit is contained in:
Filipe Brito 2019-09-16 18:00:44 -03:00 committed by Diego Mello
parent 32a681036e
commit 2b1dc27181
1 changed files with 3 additions and 1 deletions

View File

@ -231,7 +231,9 @@ class LoginSignupView extends React.Component {
const redirectUri = `${ server }/_oauth/${ service }`;
const state = this.getOAuthState();
const params = `?client_id=${ clientId }&redirect_uri=${ redirectUri }&response_type=code&state=${ state }&scope=${ scope }`;
const url = `${ serverURL }${ authorizePath }${ params }`;
const domain = `${ serverURL }`;
const absolutePath = `${ authorizePath }${ params }`;
const url = absolutePath.includes(domain) ? absolutePath : domain + absolutePath;
this.openOAuth({ url });
}