Permalink
Browse files

feat(authentication): add deprecation warning for provider.type (repl…

…aced by provider.oauthType)
  • Loading branch information...
doktordirk committed May 4, 2016
1 parent 6481c85 commit bcdf06bae13a897c98bfdf0d482fc4737fa6b4c7
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/authentication.js
@@ -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) {

0 comments on commit bcdf06b

Please sign in to comment.