react-oauth2-code-pkce
Advanced tools
Comparing version 1.8.4 to 1.8.5
export { AuthProvider, AuthContext } from './AuthContext'; | ||
export type { TAuthConfig, IAuthProvider, IAuthContext } from './Types'; | ||
export type { TAuthConfig, IAuthProvider, IAuthContext, TRefreshTokenExpiredEvent } from './Types'; |
{ | ||
"name": "react-oauth2-code-pkce", | ||
"version": "1.8.4", | ||
"version": "1.8.5", | ||
"description": "Provider agnostic react package for OAuth2 Authorization Code flow with PKCE", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -29,3 +29,3 @@ # react-oauth2-code-pkce · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/soofstad/react-oauth2-pkce/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/react-oauth2-code-pkce)](https://www.npmjs.com/package/react-oauth2-code-pkce) ![CI](https://github.com/soofstad/react-oauth2-pkce/actions/workflows/tests.yaml/badge.svg) | ||
```tsx | ||
import { AuthContext, AuthProvider, TAuthConfig } from "react-oauth2-code-pkce" | ||
import { AuthContext, AuthProvider, TAuthConfig, TRefreshTokenExpiredEvent } from "react-oauth2-code-pkce" | ||
@@ -38,2 +38,3 @@ const authConfig: TAuthConfig = { | ||
scope: 'someScope openid', | ||
onRefreshTokenExpire: (event: TRefreshTokenExpiredEvent) => window.confirm('Session expired. Refresh page to continue using the site?') && event.login(), | ||
} | ||
@@ -60,4 +61,2 @@ | ||
For more advanced examples, see `./examples/`. | ||
For instance, it's recommended to add a "Session expired"-callback like so: | ||
`onRefreshTokenExpire: (event) => window.confirm('Session expired. Refresh page to continue using the site?') && event.login(),`. | ||
@@ -154,2 +153,4 @@ ## Install | ||
This could also happend if some routes in your app are not wrapped by the `<AuthProvider>`. | ||
## Develop | ||
@@ -156,0 +157,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36645
161