From 52c06dec0c2f7cd7ec311405ae3d76685c5b2b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Tue, 24 Dec 2024 13:02:47 +0800 Subject: [PATCH] Nothing changed --- nyalcf_cli/lib/commands/authorize.dart | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/nyalcf_cli/lib/commands/authorize.dart b/nyalcf_cli/lib/commands/authorize.dart index ed6819b..079d4db 100644 --- a/nyalcf_cli/lib/commands/authorize.dart +++ b/nyalcf_cli/lib/commands/authorize.dart @@ -4,8 +4,12 @@ import 'dart:io'; // Package imports: import 'package:crypto/crypto.dart'; +// Project imports: +import 'package:nyalcf/templates/command.dart'; import 'package:nyalcf_core/models/user_info_model.dart'; import 'package:nyalcf_core/network/client/api/auth/oauth/access_token.dart'; +import 'package:nyalcf_core/network/client/api/user/frp/token.dart' + as user_frp_token; import 'package:nyalcf_core/network/client/api/user/info.dart' as user_info; import 'package:nyalcf_core/network/client/api_client.dart'; import 'package:nyalcf_core/network/server/oauth.dart'; @@ -13,12 +17,6 @@ import 'package:nyalcf_core/storages/stores/user_info_storage.dart'; import 'package:nyalcf_core/utils/logger.dart'; import 'package:nyalcf_core_extend/storages/token_storage.dart'; -// Project imports: -import 'package:nyalcf/templates/command.dart'; - -import 'package:nyalcf_core/network/client/api/user/frp/token.dart' - as user_frp_token; - class Authorize implements Command { static final _tokenStorage = TokenStorage(); @@ -30,6 +28,13 @@ class Authorize implements Command { final ApiClient api = ApiClient(); await startHttpServer(); + Logger.info( + 'Please open this link to authorize: ' + 'http://localhost:5173/auth/oauth/authorize' + '?app_id=1' + '&scopes=User,Proxy,Sign' + '&redirect_url=http://localhost:21131/oauth/callback', + ); Logger.write('Waiting callback...'); while (!_callback) {} if (_refreshToken == null) exit(1);