-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Drop RR requirement and simplify library a lot #299
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey @sergiodxa - can we expect this to get merged? I am migrating to RR7 and remix-auth is one of the last hurdles. The peer dep on @remix-run/react is causing issues for me using Happy to provide more info to assist. |
Let each strategy expect it if needed
sergiodxa
added a commit
to sergiodxa/remix-auth-form
that referenced
this pull request
Nov 27, 2024
Updated strategy to use [remix-auth v4](sergiodxa/remix-auth#299) --------- Co-authored-by: Sergio Xalambrí <hello@sergiodxa.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change how the Authenticator and Strategy classes work to drop requirement of a Remix session storage at the authenticator level.
This simplifies many things in the library, since strategies can now define the cookie/session storage to store the intermediate state they may need (like OAuth state and PKCE values) or nothing if there's no reason to use one, then instead of Remix Auth handling how the user data is stored in the application session, that depends on the app.
Because of that the
logout
method was removed, all the sessionKey, etc. options were removed, the Strategyfailure
andsuccess
methods were removed and thesuccessRedirect
andfailureRedirect
methods were removed too.The
authenticate
method will now return the user data returned by the strategy verify function, or it will throw. Here it depends on the strategy as it may only throw errors or in case of OAuth2 based strategies it may need to throw a redirect.This also brings another important change, as Remix Auth itself doesn't depends on
react-router
or any@remix-run/*
package, this means if a strategy doesn't depend on them this will work everywhere you can use Request and Response objects.Only possible Remix/Rr requirement will be how to handle throw responses.