Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
feat(authentication): add deprecation warning for provider.type (repl…
Browse files Browse the repository at this point in the history
…aced by provider.oauthType)
  • Loading branch information
doktordirk committed May 20, 2016
1 parent 6481c85 commit bcdf06b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,17 @@ export class Authentication {
* @return {Promise<response>}
*/
authenticate(name, userData = {}) {
const provider = this.config.providers[name].type === '1.0' ? this.oAuth1 : this.oAuth2;
let oauthType = this.config.providers[name].type;

return provider.open(this.config.providers[name], userData);
if (oauthType) {
LogManager.getLogger('authentication').warn('DEPRECATED: Setting provider.type is deprecated and replaced by provider.oauthType');
} else {
oauthType = this.config.providers[name].oauthType;
}

const providerLogin = oauthType === '1.0' ? this.oAuth1 : this.oAuth2;

return providerLogin.open(this.config.providers[name], userData);
}

redirect(redirectUrl, defaultRedirectUrl) {
Expand Down

0 comments on commit bcdf06b

Please sign in to comment.