Skip to content

Commit

Permalink
Release 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipenso committed Jun 1, 2015
1 parent cd84a85 commit 6519e27
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Changelog

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

### 3.0.0 / 2015-06-01
- [#49](https://github.com/seegno/angular-oauth2/pull/49) Add changelog task (@ruipenso)
- [#48](https://github.com/seegno/angular-oauth2/pull/48) Update readme (@ruipenso)
- [#25](https://github.com/seegno/angular-oauth2/pull/25) Replace ipCookie with ngCookies (@joaogranado)
- [#28](https://github.com/seegno/angular-oauth2/pull/28) Add methods to get/set `token` property (@joaogranado)
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": "3.0.0",
"version": "3.0.1",
"description": "AngularJS OAuth2",
"main": "./dist/angular-oauth2.js",
"authors": [
Expand Down
46 changes: 23 additions & 23 deletions dist/angular-oauth2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* angular-oauth2 - Angular OAuth2
* @version v3.0.0
* @version v3.0.1
* @link https://github.com/seegno/angular-oauth2
* @license MIT
*/
Expand All @@ -18,28 +18,6 @@
$httpProvider.interceptors.push("oauthInterceptor");
}
oauthConfig.$inject = [ "$httpProvider" ];
function oauthInterceptor($q, $rootScope, OAuthToken) {
return {
request: function(config) {
if (OAuthToken.getAuthorizationHeader()) {
config.headers = config.headers || {};
config.headers.Authorization = OAuthToken.getAuthorizationHeader();
}
return config;
},
responseError: function(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("www-authenticate") && 0 === rejection.headers("www-authenticate").indexOf("Bearer")) {
$rootScope.$emit("oauth:error", rejection);
}
return $q.reject(rejection);
}
};
}
oauthInterceptor.$inject = [ "$q", "$rootScope", "OAuthToken" ];
var _prototypeProperties = function(child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
Expand Down Expand Up @@ -262,5 +240,27 @@
};
this.$get.$inject = [ "$cookies" ];
}
function oauthInterceptor($q, $rootScope, OAuthToken) {
return {
request: function(config) {
if (OAuthToken.getAuthorizationHeader()) {
config.headers = config.headers || {};
config.headers.Authorization = OAuthToken.getAuthorizationHeader();
}
return config;
},
responseError: function(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("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.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "angular-oauth2",
"version": "3.0.0",
"version": "3.0.1",
"description": "Angular OAuth2",
"main": "./dist/angular-oauth2.js",
"scripts": {
"changelog": "./node_modules/.bin/github-changes -o seegno -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'"
},
"repository": {
"type": "git",
"url": "https://github.com/seegno/angular-oauth2.git"
Expand Down Expand Up @@ -57,6 +54,7 @@
"query-string": "./bower_components/query-string/query-string.js"
},
"scripts": {
"changelog": "./node_modules/.bin/github-changes -o seegno -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'",
"test": "./node_modules/.bin/gulp test --browsers Firefox"
},
"browserify-shim": {
Expand Down

0 comments on commit 6519e27

Please sign in to comment.