Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export AppState type for custom onRedirectCallback's #120

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

adamjmcgrath
Copy link
Contributor

Export AppState type so it can be used in custom onRedirectCallback's

See

import { Auth0Provider, AppState } from '@auth0/auth0-react';
const onRedirectCallback = (appState: AppState) => {
// If using a Hash Router, you need to use window.history.replaceState to
// remove the `code` and `state` query parameters from the callback url.
// window.history.replaceState({}, document.title, window.location.pathname);
history.replace((appState && appState.returnTo) || window.location.pathname);
};

Refrences

Fixes #119

@adamjmcgrath adamjmcgrath added the tiny This PR may require very low effort to action, or contains few changes to review label Sep 23, 2020
@adamjmcgrath adamjmcgrath requested a review from a team September 23, 2020 13:49
@adamjmcgrath adamjmcgrath added the CH: Fixed PR is fixing a bug label Sep 23, 2020
@adamjmcgrath adamjmcgrath merged commit a2dbc39 into master Sep 25, 2020
@evansims evansims deleted the export-appstate branch July 5, 2022 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed PR is fixing a bug tiny This PR may require very low effort to action, or contains few changes to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make AppState type more accessible
2 participants