Skip to content

Commit

Permalink
Nothing changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Dec 24, 2024
1 parent 0b18523 commit 52c06de
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions nyalcf_cli/lib/commands/authorize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ 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';
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();

Expand All @@ -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);
Expand Down

0 comments on commit 52c06de

Please sign in to comment.