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

feat: auth with alby account before node setup #779

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Nov 5, 2024

Part of #143

This moves the "Connect Alby Account" step from after the node is launched to being after the user clicks "Get Started" or "Advanced Setup". Once the auth screen is passed, the setup flow returns to normal.

This allows us to know if the user is authenticated before setting up the node, which is required because the node will be launched differently if VSS is used.

This PR also requires the user to login before starting the node in the UI (no check on the backend yet, but this should be done before starting LDK with VSS enabled). This also fixes issues where some events fail to get sent immediately after the node starts because of an expired access token.

@im-adithya
Copy link
Member

Then it might be good to also mention this VSS benefit users get by conencting their Alby Account visibly here (using some color works I think):

Screenshot 2024-11-06 at 8 40 27 PM

@rolznz
Copy link
Contributor Author

rolznz commented Nov 6, 2024

Then it might be good to also mention this VSS benefit users get by conencting their Alby Account visibly here (using some color works I think):

Ah, right. @reneaaron had an item for backups and we took it out, but it would be good to add back in. Maybe could go in #780 (I will add a TODO item)

Copy link
Member

@im-adithya im-adithya left a comment

Choose a reason for hiding this comment

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

LGTM

@rolznz
Copy link
Contributor Author

rolznz commented Nov 7, 2024

LGTM (not sure if we want to skip connect alby screen if already conected)

@im-adithya I think it would be good to fix, thanks for testing that.

@@ -117,19 +117,17 @@ func (cfg *config) init(env *AppConfig) error {
}

func (cfg *config) SetupCompleted() bool {
// TODO: remove AlbyUserIdentifier and hasLdkDir checks after 2025/01/01
// TODO: remove hasLdkDir check after 2025/01/01
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, what changed after v1.6.0? Why can't we remove both checks at once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In 1.6.0 we made the Alby Account optional, and the existence of the Alby Account was used to check if the user had setup their node (as it was the last thing that happened after setting up the node)

When we made the Alby Account optional, we instead introduced the NodeLastStartTime config entry which we use to detect if they ever went through the setup.

So for backward compatibility, we had these old checks. But now, the Alby Account can be connected before the node is setup, so I had to remove that one. I was going to remove both, but I decided to keep the LDK directory check in as this is more critical to ensure the user does not go through the setup again (and wipe their old data)

@rolznz rolznz merged commit f590c6f into master Nov 7, 2024
8 of 9 checks passed
@rolznz rolznz deleted the feat/auth-before-node-setup branch November 7, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants