-
Notifications
You must be signed in to change notification settings - Fork 147
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(shorebird_cli): Add account create command #334
Conversation
packages/shorebird_cli/lib/src/commands/account/create_account_command.dart
Outdated
Show resolved
Hide resolved
packages/shorebird_cli/lib/src/commands/account/create_account_command.dart
Outdated
Show resolved
Hide resolved
logger.info(''' | ||
Shorebird is currently only open to trusted testers. To participate, you will need a Google account for authentication. | ||
|
||
The first step is to sign in with a Google account. Please follow the sign-in link below: |
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.
Please follow the link to sign-in with your Google account:
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.
Went with "Follow the link below to authenticate:" because "your Google account" felt redundant after "Shorebird currently requires a Google account for authentication". lmk what you think
packages/shorebird_code_push_client/lib/src/code_push_client.dart
Outdated
Show resolved
Hide resolved
Co-authored-by: Felix Angelov <felix@shorebird.dev>
packages/shorebird_cli/lib/src/commands/account/create_account_command.dart
Outdated
Show resolved
Hide resolved
@@ -34,7 +34,7 @@ class CancelSubscriptionCommand extends ShorebirdCommand | |||
|
|||
final User user; | |||
try { | |||
user = await client.getCurrentUser(); | |||
user = (await client.getCurrentUser())!; |
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.
If you're already logged in we could cache the user and avoid having to make this extra request
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.
Not sure I follow – we won't be running login or signUp in this command, and we'll definitely want to get the latest subscription info for this user before dealing with subscription info.
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.
Oh sorry I think I misread this. We might want to remove the auth.isAuthenticated
check here and instead handle the case where getCurrentUser
is null rather than force unwrapping though 🤔
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.
I think this should still fail in the same way as before – if the user is null or if getCurrentUser fails in some other way, we log the error and exit. What's your concern?
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.
My concern is mainly that the error from force unwrapping a null value won't be helpful to the end user
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.
Ah! That makes sense. Updated.
@@ -1,29 +0,0 @@ | |||
import 'dart:async'; |
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.
💯
packages/shorebird_cli/test/src/commands/account/create_account_command_test.dart
Outdated
Show resolved
Hide resolved
packages/shorebird_cli/lib/src/commands/account/create_account_command.dart
Outdated
Show resolved
Hide resolved
Co-authored-by: Felix Angelov <felix@shorebird.dev>
Co-authored-by: Felix Angelov <felix@shorebird.dev>
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.
LGTM ✅
Description
Adds the
shorebird account create
command to allow users to sign up for Shorebird.Example of a user attempting to log in without an account and subsequently running
shorebird account create
:Type of Change