Giter VIP home page Giter VIP logo

Comments (6)

stefanoromanello avatar stefanoromanello commented on June 17, 2024 1

Thanks for the answer.

  1. This is strange but even with the try-catch dart isn't catching the error and I stuck with error. (Solved, the API creates the error in handle_access_token_response.dart but it doesn't catch in the authentication flow in credentials.dart both under the oauth2-1.6.1 library)
  2. Yes, this can solve the error but still, I don't get why I have this problem in the first place. The refresh token should get me a new token without a problem and the refresh token is revoked only from the account settings..

from spotify-dart.

stefanoromanello avatar stefanoromanello commented on June 17, 2024 1

Update: at each new token obtained by using the token refresh I get a new token refresh to replace the old one.

from spotify-dart.

shinyford avatar shinyford commented on June 17, 2024

I'd like to add that the exception above doesn't seem to be able to be caught:

try {
    this.api = SpotifyApi(creds);
} on AuthorizationException {
    this.api = null;
}

still throws the exception. Would be great to be able to catch the exception, at least.

from spotify-dart.

rinukkusu avatar rinukkusu commented on June 17, 2024

@stefanoromanello so your immediate problem regarding the refresh token is now fixed?

@shinyford yes, indeed - will add a todo!

from spotify-dart.

stefanoromanello avatar stefanoromanello commented on June 17, 2024

@stefanoromanello so your immediate problem regarding the refresh token is now fixed?

@shinyford yes, indeed - will add a todo!

Yes

from spotify-dart.

cosupre avatar cosupre commented on June 17, 2024

Hi everyone,

I would like to get some help.

I used the sample code from the README to save credentials with SharedPreferences after log in and get SpotifyApi object from SpotifyApiCredentials at each restart/reload of the application
But, if the refreshToken is used to get a new AccessToken, it doesn't replace the data stored in my sharedPreferences by the new accessToken and the new refreshToken . So, when I restart/reload my app, an error in thrown saying the refreshToken is revoked.

I don't have any idea about what is the best solution to store those credentials and update the saved data each time.

Thanks for your help. Say me if I need to post this in another place

Update: I saw they were a PR #87 about a refresh callback, this is exactly what I need and I will wait those changes to handle my problem.

from spotify-dart.

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.