Skip to content

Commit

Permalink
Ember.SimpleAuth - 0.5.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugisozols committed Jun 17, 2014
1 parent 8449963 commit 34cb115
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 291 deletions.
31 changes: 16 additions & 15 deletions vendor/assets/javascripts/ember-simple-auth-cookie-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,13 @@ var define, requireModule;
requireModule.registry = registry;
})();

define("ember-simple-auth-cookie-store",
["./ember-simple-auth-cookie-store/stores/cookie","exports"],
function(__dependency1__, __exports__) {
"use strict";
var Cookie = __dependency1__.Cookie;

__exports__["default"] = Cookie;
});
define("ember-simple-auth-cookie-store/stores/cookie",
["exports"],
function(__exports__) {
["ember-simple-auth/stores/base","ember-simple-auth/utils/flat_objects_are_equal","exports"],
function(__dependency1__, __dependency2__, __exports__) {
"use strict";
var Base = __dependency1__["default"];
var flatObjectsAreEqual = __dependency2__["default"];

var global = (typeof window !== 'undefined') ? window : {},
Ember = global.Ember;

Expand All @@ -86,7 +81,7 @@ define("ember-simple-auth-cookie-store/stores/cookie",
@namespace Stores
@extends Stores.Base
*/
var Cookie = Ember.SimpleAuth.Stores.Base.extend({
__exports__["default"] = Base.extend({
/**
The prefix to use for the store's cookie names so they can be distinguished
from other cookies.
Expand Down Expand Up @@ -201,7 +196,7 @@ define("ember-simple-auth-cookie-store/stores/cookie",
*/
syncData: function() {
var data = this.restore();
if (!Ember.SimpleAuth.Utils.flatObjectsAreEqual(data, this._lastData)) {
if (!flatObjectsAreEqual(data, this._lastData)) {
this._lastData = data;
this.trigger('sessionDataUpdated', data);
}
Expand All @@ -211,10 +206,16 @@ define("ember-simple-auth-cookie-store/stores/cookie",
}
}
});

__exports__.Cookie = Cookie;
});
global.Ember.SimpleAuth.Stores.Cookie = requireModule('ember-simple-auth-cookie-store').default;
define('ember-simple-auth/stores/base', ['exports'], function(__exports__) {
__exports__['default'] = global.Ember.SimpleAuth.Stores.Base;
});
define('ember-simple-auth/utils/flat_objects_are_equal', ['exports'], function(__exports__) {
__exports__['default'] = global.Ember.SimpleAuth.Utils.flatObjectsAreEqual;
});

var Cookie = requireModule('ember-simple-auth-cookie-store/stores/cookie').default;
global.Ember.SimpleAuth.Stores.Cookie = Cookie;

global.Ember.SimpleAuth.initializeExtension(function(container, application, options) {
container.register('ember-simple-auth-session-store:cookie', global.Ember.SimpleAuth.Stores.Cookie);
Expand Down
51 changes: 27 additions & 24 deletions vendor/assets/javascripts/ember-simple-auth-oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,13 @@ var define, requireModule;
requireModule.registry = registry;
})();

define("ember-simple-auth-oauth2",
["./ember-simple-auth-oauth2/authenticators/oauth2","./ember-simple-auth-oauth2/authorizers/oauth2","exports"],
define("ember-simple-auth-oauth2/authenticators/oauth2",
["ember-simple-auth/authenticators/base","ember-simple-auth/utils/is_secure_url","exports"],
function(__dependency1__, __dependency2__, __exports__) {
"use strict";
var Authenticator = __dependency1__.OAuth2;
var Authorizer = __dependency2__.OAuth2;
var Base = __dependency1__["default"];
var isSecureUrl = __dependency2__["default"];

__exports__.Authenticator = Authenticator;
__exports__.Authorizer = Authorizer;
});
define("ember-simple-auth-oauth2/authenticators/oauth2",
["exports"],
function(__exports__) {
"use strict";
var global = (typeof window !== 'undefined') ? window : {},
Ember = global.Ember;

Expand All @@ -87,7 +80,7 @@ define("ember-simple-auth-oauth2/authenticators/oauth2",
@namespace Authenticators
@extends Base
*/
var OAuth2 = Ember.SimpleAuth.Authenticators.Base.extend({
__exports__["default"] = Base.extend({
/**
Triggered when the authenticator refreshes the access token (see
[RFC 6740, section 6](http://tools.ietf.org/html/rfc6749#section-6)).
Expand Down Expand Up @@ -223,7 +216,7 @@ define("ember-simple-auth-oauth2/authenticators/oauth2",
@protected
*/
makeRequest: function(data) {
if (!Ember.SimpleAuth.Utils.isSecureUrl(this.serverTokenEndpoint)) {
if (!isSecureUrl(this.serverTokenEndpoint)) {
Ember.Logger.warn('Credentials are transmitted via an insecure connection - use HTTPS to keep them secure.');
}
return Ember.$.ajax({
Expand Down Expand Up @@ -292,13 +285,14 @@ define("ember-simple-auth-oauth2/authenticators/oauth2",
}
}
});

__exports__.OAuth2 = OAuth2;
});
define("ember-simple-auth-oauth2/authorizers/oauth2",
["exports"],
function(__exports__) {
["ember-simple-auth/authorizers/base","ember-simple-auth/utils/is_secure_url","exports"],
function(__dependency1__, __dependency2__, __exports__) {
"use strict";
var Base = __dependency1__["default"];
var isSecureUrl = __dependency2__["default"];

var global = (typeof window !== 'undefined') ? window : {},
Ember = global.Ember;

Expand All @@ -315,7 +309,7 @@ define("ember-simple-auth-oauth2/authorizers/oauth2",
@namespace Authorizers
@extends Base
*/
var OAuth2 = Ember.SimpleAuth.Authorizers.Base.extend({
__exports__["default"] = Base.extend({
/**
Authorizes an XHR request by sending the `access_token` property from the
session as a bearer token in the `Authorization` header:
Expand All @@ -331,20 +325,29 @@ define("ember-simple-auth-oauth2/authorizers/oauth2",
authorize: function(jqXHR, requestOptions) {
var accessToken = this.get('session.access_token');
if (this.get('session.isAuthenticated') && !Ember.isEmpty(accessToken)) {
if (!Ember.SimpleAuth.Utils.isSecureUrl(requestOptions.url)) {
if (!isSecureUrl(requestOptions.url)) {
Ember.Logger.warn('Credentials are transmitted via an insecure connection - use HTTPS to keep them secure.');
}
jqXHR.setRequestHeader('Authorization', 'Bearer ' + accessToken);
}
}
});

__exports__.OAuth2 = OAuth2;
});
var oauth2 = requireModule('ember-simple-auth-oauth2');
define('ember-simple-auth/authenticators/base', ['exports'], function(__exports__) {
__exports__['default'] = global.Ember.SimpleAuth.Authenticators.Base;
});
define('ember-simple-auth/authorizers/base', ['exports'], function(__exports__) {
__exports__['default'] = global.Ember.SimpleAuth.Authorizers.Base;
});
define('ember-simple-auth/utils/is_secure_url', ['exports'], function(__exports__) {
__exports__['default'] = global.Ember.SimpleAuth.Utils.isSecureUrl;
});

var Authenticator = requireModule('ember-simple-auth-oauth2/authenticators/oauth2').default;
var Authorizer = requireModule('ember-simple-auth-oauth2/authorizers/oauth2').default;

global.Ember.SimpleAuth.Authenticators.OAuth2 = oauth2.Authenticator;
global.Ember.SimpleAuth.Authorizers.OAuth2 = oauth2.Authorizer;
global.Ember.SimpleAuth.Authenticators.OAuth2 = Authenticator;
global.Ember.SimpleAuth.Authorizers.OAuth2 = Authorizer;

global.Ember.SimpleAuth.initializeExtension(function(container, application, options) {
container.register('ember-simple-auth-authorizer:oauth2-bearer', global.Ember.SimpleAuth.Authorizers.OAuth2);
Expand Down
Loading

0 comments on commit 34cb115

Please sign in to comment.