Skip to content

Commit

Permalink
4.0 release (#412)
Browse files Browse the repository at this point in the history
* bump version to 4.0.0

* ES6 Refactor (#388)

* move module from packages to repo root

* rename browser/server index

* update eslint, use ecmaVersion 2020

* feat: add typescript declarations (#413)

* feat: support typescript, use named exports

* removes "onSessionExpired" option (#444)

implements active autoRenew

* Builds to "build" folder, CDN content in "build/dist"

* Fixes compatibility with CDN / static app
  • Loading branch information
aarongranick-okta authored Aug 14, 2020
1 parent 34afcbb commit 92ed9c1
Show file tree
Hide file tree
Showing 163 changed files with 6,678 additions and 4,706 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/test/support/xhr
/test/app/public
node_modules
/build/dist
/build/lib
/build/types
/build/cjs
96 changes: 92 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"extends": ["eslint:recommended"],
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsdoc/recommended"
],
"env": {
"browser": false,
"commonjs": true
"commonjs": true,
"node": true
},
"globals": {
"Promise": true,
Expand All @@ -12,7 +19,71 @@
"setInterval": true,
"clearInterval": true
},
"settings": {
"jsdoc": {
"mode": "typescript",
"definedTags": [
"type"
]
}
},
"overrides": [
{
"files": ["polyfill/**/*", "build/polyfill/**/*"],
"env": {
"browser": true
},
"rules": {
"node/no-unsupported-features/node-builtins": ["error", {
"ignores": ["TextEncoder", "TextDecoder"]
}]
}
},
{
"files": ["build/**/*"],
"rules": {
"node/no-unpublished-require": 1,
"node/no-unpublished-import": 1
}
},
{
"files": ["{lib,build/lib}/{browser/*,crypto,pkce}.{js,ts}"],
"rules": {
"node/no-unsupported-features/node-builtins": ["error", {
"ignores": ["TextEncoder"]
}]
}
},
{
"files": [
"lib/**/*"
],
"plugins": [
"@typescript-eslint",
"jsdoc"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "./"
},
"rules": {
"node/no-missing-import": ["error", {
"allowModules": [
"@okta/okta-auth-js"
],
"tryExtensions": [".js", ".ts"]
}]
}
}
],
"rules": {
"no-var": 0,
"prefer-rest-params": 0,
"prefer-spread": 0,
"prefer-const": 0,
"node/no-unpublished-require": 0,
"node/no-unpublished-import": 0,
"camelcase": 2,
"complexity": [2, 7],
"curly": 2,
Expand All @@ -34,10 +105,27 @@
"max-len": [2, 120],
"max-params": [2, 5],
"max-statements": [2, 25],
"quotes": [2, "single"],
"quotes": [2, "single", { "allowTemplateLiterals": true }],
"semi": 2,
"strict": 0,
"wrap-iife": [2, "any"]
"wrap-iife": [2, "any"],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/triple-slash-reference": 0,
"jsdoc/require-jsdoc": 0,
"jsdoc/require-param": 0,
"jsdoc/require-returns-description": 0,
"jsdoc/require-param-description": 0,
"jsdoc/require-returns": 0,
"jsdoc/no-undefined-types": 0

},
"root": true
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DS_Store
dist
build
target
node_modules
build2
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"args": [
"--runInBand",
"--no-cache",
"--config=packages/okta-auth-js/jest.browser.js",
"--config=jest.browser.js",
"${relativeFile}"
],
"console": "integratedTerminal",
Expand All @@ -26,7 +26,7 @@
"args": [
"--runInBand",
"--no-cache",
"--config=packages/okta-auth-js/jest.browser.js",
"--config=jest.server.js",
"${relativeFile}"
],
"console": "integratedTerminal",
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Changelog

## 4.0.0

### Features

- [#413](https://github.com/okta/okta-auth-js/pull/413) Adds support for Typescript. Uses named exports instead of default export.
- [#444](https://github.com/okta/okta-auth-js/pull/444) New method `tokenManager.hasExpired` to test if a token is expired

### Breaking Changes

- [#444](https://github.com/okta/okta-auth-js/pull/444)
- Implements "active" autoRenew. Previously tokens would be renewed or removed when calling `tokenManager.get`. Now they will be renewed or removed in the background. If autoRenew is true, tokens will be renewed before expiration. If autoRenew is false, tokens will be removed from storage on expiration.
- `onSessionExpired` option has been removed. [TokenManager events](#tokenmanageronevent-callback-context) can be used to detect and handle token renewal errors.
- `tokenManager.get` no longer implements autoRenew functionality (autoRenew is done by a separate process within `TokenManager`). Even with `autoRenew`, it is possible that the token returned from the TokenManager may be expired, since renewal is an asynchronous process. New method `tokenManager.hasExpired` can be used to test the token and avoid this potential race condition.

## 3.2.3

### Bug Fixes

- [#440](https://github.com/okta/okta-auth-js/pull/440) Fixes signOut XHR fallback to reload page only if postLogoutRedirectUri matches the current URI
- [#445](https://github.com/okta/okta-auth-js/pull/445) Clears access token from storage after token revocation

Expand Down
Loading

0 comments on commit 92ed9c1

Please sign in to comment.