Giter Site home page Giter Site logo

Comments (5)

nlien avatar nlien commented on May 20, 2024 1

If updateToken() from the Keycloak JS adapter is the only thing that'll help, I guess this function also has to be exposed.

I'm wondering if it's better to just expose the whole Keycloak object altogether, acting like a proxy, so every function/property is exposed always....

from vue-keycloak-js.

nlien avatar nlien commented on May 20, 2024

I'm not sure if this will help you, but what about intercepting http requests and inspecting the status code?
For example with Axios, like this:

axios.interceptors.response.use(response => {
  return response
}, error => {
  if (error.response.status === 403) {
    // Do something
  } else {
    return Promise.reject(error)
  }
})

from vue-keycloak-js.

CryptoZorro avatar CryptoZorro commented on May 20, 2024

Yes that's exactly what I wanted to do as well, my actual question was, where you got // Do something, how do call updateToken(), so that I can retry my api call?

from vue-keycloak-js.

CryptoZorro avatar CryptoZorro commented on May 20, 2024

I agree, there could be many use cases, where I see the updateToken being manually triggered. For example, I would like to updateToken on window.onfocus()... The plugin will be totally flexible!

from vue-keycloak-js.

baltom avatar baltom commented on May 20, 2024

@CryptoZorro this should now be possible with version 1.3.1+ by doing Vue.$keycloak.keycloak.updateToken(60)

from vue-keycloak-js.

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.