Giter Club home page Giter Club logo

trakt_dart's People

Stargazers

Easion avatar  avatar Chardinson Ventura avatar Elias avatar

Watchers

Damonique Blake avatar

trakt_dart's Issues

Device Auth not working [request errors]

HI Im gettting error ,

Unhandled Exception: Bad state: Cannot set the body fields of a Request with content-type "application/json".

  /// Generate new codes to start the device authentication process.
  ///
  /// The device_code and interval will be used later to poll for the access_token.
  /// The user_code and verification_url should be presented to the user as mentioned in the flow steps above.
  Future<DeviceCodeResponse> generateDeviceCodes({bool? signup}) async {
    final url = Uri.https(_manager._baseURL, "oauth/device/code");
    final response = await _manager.client.post(url,
        headers: {"Content-Type": "application/json"},
        body: jsonEncode({"client_id": _manager._clientId});

    if (![200, 201, 204].contains(response.statusCode)) {
      throw TraktManagerAPIError(
          response.statusCode, response.reasonPhrase, response);
    }

    final jsonResult = jsonDecode(response.body);
    return DeviceCodeResponse.fromJsonModel(jsonResult);
  }

My Code assume its ok

  Future<void> traktAuth() async {
    var auth = traktManager.authentication;
    final deviceCode = await auth.generateDeviceCodes();
    final accessTokenRepsonse =
        await auth.getAccessToken(deviceCode.deviceCode);
  }

DeviceAuthentication

I can't understand how got accesstoken. Ok the generateDeviceCodes but how can I get the accesstoken? ๐Ÿ˜ฅ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.