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

React Router v6 + Auth Flow #384

Merged
merged 21 commits into from
Nov 23, 2021
Merged

React Router v6 + Auth Flow #384

merged 21 commits into from
Nov 23, 2021

Conversation

dylancom
Copy link
Contributor

@dylancom dylancom commented Nov 15, 2021

  • Upgraded from v5. (Many API changes)
  • Added auth-flow (using context). Protected screens will not be viewable anymore when locked.

@github-actions
Copy link

Build files:

@dylancom dylancom changed the title Upgrade to React Router v6 React Router v6 + Auth Flow Nov 16, 2021
@bumi bumi added the chore Cleanup, refactorings and other maintenance tasks label Nov 19, 2021
@bumi
Copy link
Collaborator

bumi commented Nov 20, 2021

No matching routes for adding a new account from the options page:

-  No routes matched location "/accounts/new/lnd-hub" index.js:21:48
- No routes matched location "/accounts/new/lnd" index.js:21:48

@dylancom
Copy link
Contributor Author

Fixed

Copy link
Collaborator

@bumi bumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say much about the code and it is hard to compare. So far it works great, I will keep testing it more and we should soon merge this to prevent further merge conflicts.
can you maybe rebase this one?


const unlock = (password: string, callback: VoidFunction) => {
return utils.call("unlock", { password }).then(() => {
setUser("alby");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we call setUser with "alby"? - can we document that somewhere?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if calling it user is the best here... we will always only have one user, but multiple accounts. maybe we can "authenticate" towards one account? and store here which account is currently used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently "alby" is just a placeholder, could be "user" aswel. We only check for the presence of a value inside the app. But we could store here also which account is currently used.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we call it account or something like currentAccount then we would not introduce another terminology/entity.

Copy link
Collaborator

@bumi bumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had some minor comments about some debug logs that we can remove probably?

Let's merge it and then test the app in detail again. @MoritzKa can you also do another testing round

src/app/context/AuthContext.tsx Outdated Show resolved Hide resolved
src/app/screens/Publisher.tsx Outdated Show resolved Hide resolved
src/extension/background-script/actions/accounts/unlock.js Outdated Show resolved Hide resolved
@bumi
Copy link
Collaborator

bumi commented Nov 23, 2021

@dylancom can you rebase and then merge?

dylancom and others added 5 commits November 23, 2021 10:23
Co-authored-by: Michael Bumann <hello@michaelbumann.com>
Co-authored-by: Michael Bumann <hello@michaelbumann.com>
Co-authored-by: Michael Bumann <hello@michaelbumann.com>
@dylancom dylancom merged commit e19ae55 into master Nov 23, 2021
@dylancom dylancom deleted the upgrade/react-router-v6 branch November 23, 2021 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Cleanup, refactorings and other maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants