Skip to content

Commit e90bd56

Browse files
committed
Release 4.1.1
1 parent 2524f17 commit e90bd56

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
## Changelog
22

3+
### 4.1.1 / 2017-04-03
4+
- [#118](https://github.com/oauthjs/angular-oauth2/pull/118) Validate object property access (@hitmanmcc)
5+
- [#107](https://github.com/oauthjs/angular-oauth2/pull/107) Updated readme (@anteriovieira)
6+
37
### 4.1.0 / 2016-11-03
48
- [#87](https://github.com/oauthjs/angular-oauth2/pull/87) allow overriding oauth base config using options (@lionelB)
9+
- [#96](https://github.com/oauthjs/angular-oauth2/pull/96) Specify the type of grant used (#96) (@Timokasse)
510

611
### 4.0.0 / 2016-02-12
712
- [#80](https://github.com/oauthjs/angular-oauth2/pull/80) Reintroduce authorization header to be overridden (@ruipenso)
@@ -37,7 +42,7 @@
3742
### 2.0.0 / 2015-02-04
3843
- [#11](https://github.com/oauthjs/angular-oauth2/pull/11) Add options to `ipCookie.remove()` on OAuthToken (@ruipenso)
3944
- [#10](https://github.com/oauthjs/angular-oauth2/pull/10) Update `oauthInterceptor` responseError handling (@ruipenso)
40-
- [#7](https://github.com/oauthjs/angular-oauth2/pull/7) Fix readme typo of download url (@brunnolou)
45+
- [#7](https://github.com/oauthjs/angular-oauth2/pull/7) Fix readme typo of download url (@seegno)
4146
- [#6](https://github.com/oauthjs/angular-oauth2/pull/6) README.md: typo fix (@AdirAmsalem)
4247

4348
### 1.0.2 / 2015-01-19

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-oauth2",
3-
"version": "4.0.0",
3+
"version": "4.1.1",
44
"description": "AngularJS OAuth2",
55
"main": "./dist/angular-oauth2.js",
66
"authors": [
@@ -23,8 +23,8 @@
2323
"test"
2424
],
2525
"dependencies": {
26-
"angular": "^1.4.0",
27-
"angular-cookies": "^1.4.0",
26+
"angular": "1.5.9",
27+
"angular-cookies": "1.5.9",
2828
"query-string": "^1.0.0"
2929
}
3030
}

dist/angular-oauth2.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* angular-oauth2 - Angular OAuth2
3-
* @version v4.1.0
3+
* @version v4.1.1
44
* @link https://github.com/seegno/angular-oauth2
55
* @license MIT
66
*/
@@ -14,6 +14,10 @@
1414
}
1515
})(this, function(angular, ngCookies, queryString) {
1616
var ngModule = angular.module("angular-oauth2", [ ngCookies ]).config(oauthConfig).factory("oauthInterceptor", oauthInterceptor).provider("OAuth", OAuthProvider).provider("OAuthToken", OAuthTokenProvider);
17+
function oauthConfig($httpProvider) {
18+
$httpProvider.interceptors.push("oauthInterceptor");
19+
}
20+
oauthConfig.$inject = [ "$httpProvider" ];
1721
function oauthInterceptor($q, $rootScope, OAuthToken) {
1822
return {
1923
request: function request(config) {
@@ -24,22 +28,21 @@
2428
return config;
2529
},
2630
responseError: function responseError(rejection) {
31+
if (!rejection) {
32+
return $q.reject(rejection);
33+
}
2734
if (400 === rejection.status && rejection.data && ("invalid_request" === rejection.data.error || "invalid_grant" === rejection.data.error)) {
2835
OAuthToken.removeToken();
2936
$rootScope.$emit("oauth:error", rejection);
3037
}
31-
if (401 === rejection.status && rejection.data && "invalid_token" === rejection.data.error || rejection.headers("www-authenticate") && 0 === rejection.headers("www-authenticate").indexOf("Bearer")) {
38+
if (401 === rejection.status && rejection.data && "invalid_token" === rejection.data.error || rejection.headers && rejection.headers("www-authenticate") && 0 === rejection.headers("www-authenticate").indexOf("Bearer")) {
3239
$rootScope.$emit("oauth:error", rejection);
3340
}
3441
return $q.reject(rejection);
3542
}
3643
};
3744
}
3845
oauthInterceptor.$inject = [ "$q", "$rootScope", "OAuthToken" ];
39-
function oauthConfig($httpProvider) {
40-
$httpProvider.interceptors.push("oauthInterceptor");
41-
}
42-
oauthConfig.$inject = [ "$httpProvider" ];
4346
var _createClass = function() {
4447
function defineProperties(target, props) {
4548
for (var i = 0; i < props.length; i++) {
@@ -239,25 +242,33 @@
239242
}, {
240243
key: "getAccessToken",
241244
value: function getAccessToken() {
242-
return this.getToken() ? this.getToken().access_token : undefined;
245+
var _ref = this.getToken() || {};
246+
var access_token = _ref.access_token;
247+
return access_token;
243248
}
244249
}, {
245250
key: "getAuthorizationHeader",
246251
value: function getAuthorizationHeader() {
247-
if (!(this.getTokenType() && this.getAccessToken())) {
252+
var tokenType = this.getTokenType();
253+
var accessToken = this.getAccessToken();
254+
if (!tokenType || !accessToken) {
248255
return;
249256
}
250-
return this.getTokenType().charAt(0).toUpperCase() + this.getTokenType().substr(1) + " " + this.getAccessToken();
257+
return tokenType.charAt(0).toUpperCase() + tokenType.substr(1) + " " + accessToken;
251258
}
252259
}, {
253260
key: "getRefreshToken",
254261
value: function getRefreshToken() {
255-
return this.getToken() ? this.getToken().refresh_token : undefined;
262+
var _ref2 = this.getToken() || {};
263+
var refresh_token = _ref2.refresh_token;
264+
return refresh_token;
256265
}
257266
}, {
258267
key: "getTokenType",
259268
value: function getTokenType() {
260-
return this.getToken() ? this.getToken().token_type : undefined;
269+
var _ref3 = this.getToken() || {};
270+
var token_type = _ref3.token_type;
271+
return token_type;
261272
}
262273
}, {
263274
key: "removeToken",

dist/angular-oauth2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-oauth2",
3-
"version": "4.1.0",
3+
"version": "4.1.1",
44
"description": "Angular OAuth2",
55
"main": "./dist/angular-oauth2.js",
66
"repository": {
@@ -53,7 +53,7 @@
5353
"yargs": "^3.6.0"
5454
},
5555
"scripts": {
56-
"changelog": "./node_modules/.bin/github-changes -o seegno -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'",
56+
"changelog": "./node_modules/.bin/github-changes -o oauthjs -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'",
5757
"test": "./node_modules/.bin/gulp test --browsers Firefox"
5858
}
5959
}

0 commit comments

Comments
 (0)