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

Improve successRedirect and failureRedirect types #164

Merged
merged 4 commits into from
May 26, 2022

Conversation

gsawers1
Copy link
Contributor

@gsawers1 gsawers1 commented Apr 20, 2022

Adds an overload typing to the isAuthenticated function for if successRedirect and failureRedirect are both defined.

This fixes an issue where calling the function with both redirects specified will fail to compile.

gsawers1 and others added 2 commits April 20, 2022 16:54
Adds an overload typing to the isAuthenticated function for if successRedirect and failureRedirect are both defined.
@gsawers1 gsawers1 marked this pull request as ready for review April 21, 2022 00:04
src/authenticator.ts Outdated Show resolved Hide resolved
src/authenticator.ts Outdated Show resolved Hide resolved
If a user is logged in, its going to redirect instead of returning the user, so will always be a null return.
@sergiodxa sergiodxa changed the title Both successRedirect and failureRedirect types Improve successRedirect and failureRedirect types May 26, 2022
@sergiodxa sergiodxa added the enhancement New feature or request label May 26, 2022
@sergiodxa sergiodxa merged commit 3443a05 into sergiodxa:main May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants