Skip to content

Commit

Permalink
Release 4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pgom committed Jan 24, 2018
1 parent f3904d2 commit 35c0c03
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

### 4.2.0 / 2018-01-24
- [#127](https://github.com/oauthjs/angular-oauth2/pull/127) Prevent loading angular multiple times with webpack (@erhardos)

### 4.1.1 / 2017-04-03
- [#118](https://github.com/oauthjs/angular-oauth2/pull/118) Validate object property access (@hitmanmcc)
- [#107](https://github.com/oauthjs/angular-oauth2/pull/107) Updated readme (@anteriovieira)
Expand All @@ -22,13 +25,13 @@
- [#76](https://github.com/oauthjs/angular-oauth2/pull/76) Update `package.json` (@ruipenso)

### 3.0.1 / 2015-06-01
- [#27](https://github.com/oauthjs/angular-oauth2/pull/27) Add travis-ci configuration (@joaogranado)
- [#27](https://github.com/oauthjs/angular-oauth2/pull/27) Add travis-ci configuration (@seegno)

### 3.0.0 / 2015-06-01
- [#49](https://github.com/oauthjs/angular-oauth2/pull/49) Add changelog task (@ruipenso)
- [#48](https://github.com/oauthjs/angular-oauth2/pull/48) Update readme (@ruipenso)
- [#25](https://github.com/oauthjs/angular-oauth2/pull/25) Replace ipCookie with ngCookies (@joaogranado)
- [#28](https://github.com/oauthjs/angular-oauth2/pull/28) Add methods to get/set `token` property (@joaogranado)
- [#25](https://github.com/oauthjs/angular-oauth2/pull/25) Replace ipCookie with ngCookies (@seegno)
- [#28](https://github.com/oauthjs/angular-oauth2/pull/28) Add methods to get/set `token` property (@seegno)
- [#47](https://github.com/oauthjs/angular-oauth2/pull/47) Add unauthorized error interception (@ruipenso)

### 2.1.1 / 2015-05-28
Expand All @@ -46,7 +49,7 @@
- [#6](https://github.com/oauthjs/angular-oauth2/pull/6) README.md: typo fix (@AdirAmsalem)

### 1.0.2 / 2015-01-19
- [#4](https://github.com/oauthjs/angular-oauth2/pull/4) Add support for higher dependencies versions (@joaogranado)
- [#4](https://github.com/oauthjs/angular-oauth2/pull/4) Add support for higher dependencies versions (@seegno)

### 1.0.1 / 2015-01-19
- [#3](https://github.com/oauthjs/angular-oauth2/pull/3) Fix bower ignore list (@ruipenso)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-oauth2",
"version": "4.1.1",
"version": "4.2.0",
"description": "AngularJS OAuth2",
"main": "./dist/angular-oauth2.js",
"authors": [
Expand Down
50 changes: 25 additions & 25 deletions dist/angular-oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,6 @@
$httpProvider.interceptors.push("oauthInterceptor");
}
oauthConfig.$inject = [ "$httpProvider" ];
function oauthInterceptor($q, $rootScope, OAuthToken) {
return {
request: function request(config) {
config.headers = config.headers || {};
if (!config.headers.hasOwnProperty("Authorization") && OAuthToken.getAuthorizationHeader()) {
config.headers.Authorization = OAuthToken.getAuthorizationHeader();
}
return config;
},
responseError: function responseError(rejection) {
if (!rejection) {
return $q.reject(rejection);
}
if (400 === rejection.status && rejection.data && ("invalid_request" === rejection.data.error || "invalid_grant" === rejection.data.error)) {
OAuthToken.removeToken();
$rootScope.$emit("oauth:error", rejection);
}
if (401 === rejection.status && rejection.data && "invalid_token" === rejection.data.error || rejection.headers && rejection.headers("www-authenticate") && 0 === rejection.headers("www-authenticate").indexOf("Bearer")) {
$rootScope.$emit("oauth:error", rejection);
}
return $q.reject(rejection);
}
};
}
oauthInterceptor.$inject = [ "$q", "$rootScope", "OAuthToken" ];
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
Expand Down Expand Up @@ -282,5 +257,30 @@
};
this.$get.$inject = [ "$cookies" ];
}
function oauthInterceptor($q, $rootScope, OAuthToken) {
return {
request: function request(config) {
config.headers = config.headers || {};
if (!config.headers.hasOwnProperty("Authorization") && OAuthToken.getAuthorizationHeader()) {
config.headers.Authorization = OAuthToken.getAuthorizationHeader();
}
return config;
},
responseError: function responseError(rejection) {
if (!rejection) {
return $q.reject(rejection);
}
if (400 === rejection.status && rejection.data && ("invalid_request" === rejection.data.error || "invalid_grant" === rejection.data.error)) {
OAuthToken.removeToken();
$rootScope.$emit("oauth:error", rejection);
}
if (401 === rejection.status && rejection.data && "invalid_token" === rejection.data.error || rejection.headers && rejection.headers("www-authenticate") && 0 === rejection.headers("www-authenticate").indexOf("Bearer")) {
$rootScope.$emit("oauth:error", rejection);
}
return $q.reject(rejection);
}
};
}
oauthInterceptor.$inject = [ "$q", "$rootScope", "OAuthToken" ];
return ngModule;
});
2 changes: 1 addition & 1 deletion dist/angular-oauth2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-oauth2",
"version": "4.1.1",
"version": "4.2.0",
"description": "Angular OAuth2",
"main": "./dist/angular-oauth2.js",
"repository": {
Expand Down

0 comments on commit 35c0c03

Please sign in to comment.