Skip to content

Commit

Permalink
feat(globe_cli): added login url in output of login command
Browse files Browse the repository at this point in the history
  • Loading branch information
kaziwaseef committed Jan 19, 2024
1 parent 71c5988 commit d8e2640
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/globe_cli/lib/src/commands/login_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class LoginCommand extends BaseGlobeCommand {
onConnected: (port) async {
logger.info('Please authenticate via the opened browser window.');
// TODO can we react to openUrl close, to have the command emit a "failed to login"?
final url = '$endpoint/login/cli?callback=http://localhost:$port/callback?strategy=${GlobeHttpServerRedirectStrategy.redirect.name}';
logger.info('\nOr go to this link: $url\n');
await openUrl(
'$endpoint/login/cli?callback=http://localhost:$port/callback?strategy=${GlobeHttpServerRedirectStrategy.redirect.name}',
url,
);
},
);
Expand Down
3 changes: 1 addition & 2 deletions packages/globe_cli/lib/src/utils/open_url.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ String get _openUrlCommand {
return 'open';
} else {
throw UnsupportedError(
'Operating system not supported by the open_url '
'package: ${Platform.operatingSystem}',
'Operating system not supported: ${Platform.operatingSystem}',
);
}
}

0 comments on commit d8e2640

Please sign in to comment.