Skip to content

Commit

Permalink
Removed insecure credentials transmission warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jpadilla committed Jan 18, 2015
1 parent f2ae79e commit b9537a2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 44 deletions.
4 changes: 0 additions & 4 deletions addon/authenticators/token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember';
import Base from 'simple-auth/authenticators/base';
import isSecureUrl from '../utils/is-secure-url';
import Configuration from '../configuration';

/**
Expand Down Expand Up @@ -153,9 +152,6 @@ export default Base.extend({
@private
*/
makeRequest: function(data) {
if (!isSecureUrl(this.serverTokenEndpoint)) {
Ember.Logger.warn('Credentials are transmitted via an insecure connection - use HTTPS to keep them secure.');
}
return Ember.$.ajax({
url: this.serverTokenEndpoint,
type: 'POST',
Expand Down
8 changes: 1 addition & 7 deletions addon/authorizers/token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember';
import Base from 'simple-auth/authorizers/base';
import isSecureUrl from '../utils/is-secure-url';
import Configuration from '../configuration';

/**
Expand Down Expand Up @@ -75,16 +74,11 @@ export default Base.extend({
@method authorize
@param {jqXHR} jqXHR The XHR request to authorize (see http://api.jquery.com/jQuery.ajax/#jqXHR)
@param {Object} requestOptions The options as provided to the `$.ajax` method (see http://api.jquery.com/jQuery.ajaxPrefilter/)
*/
authorize: function(jqXHR, requestOptions) {
authorize: function(jqXHR) {
var token = this.buildToken();

if (this.get('session.isAuthenticated') && !Ember.isEmpty(token)) {
if (!isSecureUrl(requestOptions.url)) {
Ember.Logger.warn('Credentials are transmitted via an insecure connection - use HTTPS to keep them secure.');
}

if(this.authorizationPrefix) {
token = this.authorizationPrefix + token;
}
Expand Down
10 changes: 0 additions & 10 deletions addon/utils/is-secure-url.js

This file was deleted.

23 changes: 0 additions & 23 deletions tests/unit/utils/is-secure-url-test.js

This file was deleted.

1 comment on commit b9537a2

@dennismende
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Please sign in to comment.