Skip to content

Commit

Permalink
Release 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipenso committed Apr 3, 2017
1 parent 2524f17 commit e90bd56
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## Changelog

### 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)

### 4.1.0 / 2016-11-03
- [#87](https://github.com/oauthjs/angular-oauth2/pull/87) allow overriding oauth base config using options (@lionelB)
- [#96](https://github.com/oauthjs/angular-oauth2/pull/96) Specify the type of grant used (#96) (@Timokasse)

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

### 1.0.2 / 2015-01-19
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-oauth2",
"version": "4.0.0",
"version": "4.1.1",
"description": "AngularJS OAuth2",
"main": "./dist/angular-oauth2.js",
"authors": [
Expand All @@ -23,8 +23,8 @@
"test"
],
"dependencies": {
"angular": "^1.4.0",
"angular-cookies": "^1.4.0",
"angular": "1.5.9",
"angular-cookies": "1.5.9",
"query-string": "^1.0.0"
}
}
33 changes: 22 additions & 11 deletions dist/angular-oauth2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* angular-oauth2 - Angular OAuth2
* @version v4.1.0
* @version v4.1.1
* @link https://github.com/seegno/angular-oauth2
* @license MIT
*/
Expand All @@ -14,6 +14,10 @@
}
})(this, function(angular, ngCookies, queryString) {
var ngModule = angular.module("angular-oauth2", [ ngCookies ]).config(oauthConfig).factory("oauthInterceptor", oauthInterceptor).provider("OAuth", OAuthProvider).provider("OAuthToken", OAuthTokenProvider);
function oauthConfig($httpProvider) {
$httpProvider.interceptors.push("oauthInterceptor");
}
oauthConfig.$inject = [ "$httpProvider" ];
function oauthInterceptor($q, $rootScope, OAuthToken) {
return {
request: function request(config) {
Expand All @@ -24,22 +28,21 @@
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("www-authenticate") && 0 === rejection.headers("www-authenticate").indexOf("Bearer")) {
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" ];
function oauthConfig($httpProvider) {
$httpProvider.interceptors.push("oauthInterceptor");
}
oauthConfig.$inject = [ "$httpProvider" ];
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
Expand Down Expand Up @@ -239,25 +242,33 @@
}, {
key: "getAccessToken",
value: function getAccessToken() {
return this.getToken() ? this.getToken().access_token : undefined;
var _ref = this.getToken() || {};
var access_token = _ref.access_token;
return access_token;
}
}, {
key: "getAuthorizationHeader",
value: function getAuthorizationHeader() {
if (!(this.getTokenType() && this.getAccessToken())) {
var tokenType = this.getTokenType();
var accessToken = this.getAccessToken();
if (!tokenType || !accessToken) {
return;
}
return this.getTokenType().charAt(0).toUpperCase() + this.getTokenType().substr(1) + " " + this.getAccessToken();
return tokenType.charAt(0).toUpperCase() + tokenType.substr(1) + " " + accessToken;
}
}, {
key: "getRefreshToken",
value: function getRefreshToken() {
return this.getToken() ? this.getToken().refresh_token : undefined;
var _ref2 = this.getToken() || {};
var refresh_token = _ref2.refresh_token;
return refresh_token;
}
}, {
key: "getTokenType",
value: function getTokenType() {
return this.getToken() ? this.getToken().token_type : undefined;
var _ref3 = this.getToken() || {};
var token_type = _ref3.token_type;
return token_type;
}
}, {
key: "removeToken",
Expand Down
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.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-oauth2",
"version": "4.1.0",
"version": "4.1.1",
"description": "Angular OAuth2",
"main": "./dist/angular-oauth2.js",
"repository": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"yargs": "^3.6.0"
},
"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'",
"changelog": "./node_modules/.bin/github-changes -o oauthjs -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'",
"test": "./node_modules/.bin/gulp test --browsers Firefox"
}
}

0 comments on commit e90bd56

Please sign in to comment.