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

Make RedirectLoginOptions and RedirectLoginResult accept generic AppState #846

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

frederikprijck
Copy link
Member

This SDK uses an appState property on both RedirectLoginOptions and RedirectLoginResult, allowing consumers to put object of any type as the appState on login, and get the values back from the transaction.

This PR adds a generic parameter to both RedirectLoginOptions and RedirectLoginResult so that consumers can specify the type for the appState they are using.

For example, the angular sdk uses { target: string } (https://github.com/auth0/auth0-angular/blob/master/projects/auth0-angular/src/lib/auth.service.ts#L305) for the appState to restore the previous route after redirecting, however the users have no type hinting and have no idea that appState accepts a target property because appState is of type any.

@frederikprijck frederikprijck requested a review from a team as a code owner November 30, 2021 12:28
@frederikprijck frederikprijck marked this pull request as draft November 30, 2021 12:38
@frederikprijck frederikprijck marked this pull request as ready for review November 30, 2021 13:01
@frederikprijck frederikprijck added CH: Changed PR is changing something review:medium Medium review labels Nov 30, 2021
@stevehobbsdev
Copy link
Contributor

Looks good, we'll likely want to reflect this change in auth0-react as well @adamjmcgrath

@stevehobbsdev stevehobbsdev merged commit 9c834f1 into master Nov 30, 2021
@stevehobbsdev stevehobbsdev deleted the feat/generic-app-state branch November 30, 2021 15:23
@stevehobbsdev stevehobbsdev mentioned this pull request Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Changed PR is changing something review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants