-
Notifications
You must be signed in to change notification settings - Fork 59
Use auth0-react #233
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
Use auth0-react #233
Conversation
Refactor processSignIn to use returnTo. Refactor accordingly.
landonreed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't fully tested this yet, but it needs a couple of code changes/comments
evansiroky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one refactoring comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments from phone discussion in addition to implementing snippet in create/init user:
const isNewAccount = fetchStatus === 'error' || (user && user.result === 'ERR')
const userData = isNewAccount ? createNewUser(authUser) : user
dispatch(setCurrentUser({ accessToken, user: userData }))
if (!isNewAccount) {
dispatch(fetchUserMonitoredTrips())
}
landonreed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of tiny loose ends.
|
FYI @landonreed and @evansiroky there are some not-so-obvious merge changes I addressed in b27eb18. This PR should be ready to merge now. |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR replaces the no-longer-maintained
use-auth0-hookslibrary with its successorauth0-react.This PR also improves the following:
Codewise:
appState.returnTois used where possible (fixes If logging out on local dev environment, does not redirect to localhost:9966 #253), methodprocessSignInis simplified.Constant(unchanged, see Use auth0-react #233 (comment))URL_ROOTis replaced with the standardwindow.location.origin.withLoggedInUserSupporthigher order component (removedrenderChildrenWithPropsutil method.state.user.loggedInUserMonitoredTripsnow asynchronously fetched after fetchingstate.user.loggedInUser.