Skip to content

Commit

Permalink
fix: #1231 fix the return type of signinCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
pamapa committed Oct 4, 2024
1 parent d19b3be commit 3345125
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/react-oidc-context.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface AuthProviderBaseProps {
children?: React_2.ReactNode;
matchSignoutCallback?: (args: UserManagerSettings) => boolean;
onRemoveUser?: () => Promise<void> | void;
onSigninCallback?: (user: User | void) => Promise<void> | void;
onSigninCallback?: (user: User | undefined) => Promise<void> | void;
onSignoutCallback?: () => Promise<void> | void;
skipSigninCallback?: boolean;
}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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
Expand Up @@ -40,7 +40,7 @@
"prepare": "husky"
},
"peerDependencies": {
"oidc-client-ts": "^3.0.0",
"oidc-client-ts": "^3.1.0",
"react": ">=16.8.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface AuthProviderBaseProps {
* Here you can remove the code and state parameters from the url when you are redirected from the authorize page.
*
* ```jsx
* const onSigninCallback = (_user: User | void): void => {
* const onSigninCallback = (_user: User | undefined): void => {
* window.history.replaceState(
* {},
* document.title,
Expand All @@ -32,7 +32,7 @@ export interface AuthProviderBaseProps {
* }
* ```
*/
onSigninCallback?: (user: User | void) => Promise<void> | void;
onSigninCallback?: (user: User | undefined) => Promise<void> | void;

/**
* By default, if the page url has code/state params, this provider will call automatically the `userManager.signinCallback`.
Expand Down Expand Up @@ -224,7 +224,7 @@ export const AuthProvider = (props: AuthProviderProps): JSX.Element => {
void (async (): Promise<void> => {
// sign-in
try {
let user: User | void | null = null;
let user: User | undefined | null = null;

// check if returning back from authority server
if (hasAuthParams() && !skipSigninCallback) {
Expand Down

0 comments on commit 3345125

Please sign in to comment.