Skip to content

Error on authorize #4

@Wazted

Description

@Wazted

Hi, I'm getting this error:
flutter: An exception occurred during a sign-in attempt: FlutterAuthException({code: FlutterAuthExceptionCode.login, message: An unknown http error occurred, details: {code:: -1002, url: https://twitter.com/oauth/authorize}})

but my actual code is:

final auth = TwitterAuth(
    clientId: 'xxxx',
    clientSecret: 'xxxx',
    callbackUrl: 'xxxx://',
  );

  void _loginTW() async {
    try {
      final resp = await auth.login(context);
      print("Successfully logged in $resp");
       Future.delayed(const Duration(milliseconds: 500), () {
          Navigator.pushNamed(context, '/home', arguments: resp.token);
        });
    } on FlutterAuthException catch (e) {
      switch (e.code) {
        case FlutterAuthExceptionCode.cancelled:
          print('Sign-in process was cancelled by user: ${e.toString()}');
          break;
        case FlutterAuthExceptionCode.network:
          print('A network exception was thrown: ${e.toString()}');
          break;
        case FlutterAuthExceptionCode.login:
          print(
              'An exception occurred during a sign-in attempt: ${e.toString()}');
          break;
      };
    }

  }

Does it comes from my Twitter App or somewhere I can`t see ??

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions