Git Product home page Git Product logo

Comments (5)

henrikfroehling avatar henrikfroehling commented on May 24, 2024

@aspik Could you please provide the steps on how to reproduce this error? And a stack trace would be nice.

from trakt.net.

aspik avatar aspik commented on May 24, 2024

Sure:

  1. start the client,
  2. authorize with pin:
    https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Models/TraktSetupModel.cs#L120
  3. save the response to file:
    https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Models/TraktSetupModel.cs#L269-L274
  4. close the client,
  5. start the client,
  6. refresh the authorization by exchanging the refresh token:
    https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/LibrarySynchronization.cs#L447-L464
    https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/TraktClientProxy.cs#L58

Result: exception with message: "not authorized" is thrown.

I'm afraid that the stack trace will not be helpful. I'm using a wrapper around the TraktClient (for unit tests purpose ), and I can catch only the AggregateException:
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/TraktClientProxy.cs#L281-L294

from trakt.net.

henrikfroehling avatar henrikfroehling commented on May 24, 2024

@aspik I think, you didn't set the saved authorization in the client.
https://github.com/aspik/TraktPluginMP2/blob/master/TraktPluginMP2/TraktPluginMP2/Services/LibrarySynchronization.cs#L460

There might be missing this:

_traktClient.Authorization = savedAuth;

See the example "Serialize and deserialize authorization information" at https://github.com/henrikfroehling/Trakt.NET#basic-usage

from trakt.net.

aspik avatar aspik commented on May 24, 2024

This was not needed with the old lib. And tbh I'm not sure why I have to do it? :) its only the refreshtoken which matters.
I just restored back the old check in the new version, compiled it and exchanged in my plugin. Now is all working as before :)

from trakt.net.

henrikfroehling avatar henrikfroehling commented on May 24, 2024

Ah, okay. You're right, that should also work with just the refresh token.

from trakt.net.

Related Issues (20)

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.