question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite refresh every 5 sec

See original GitHub issue

I have a problem. In different browsers I can see page refresh every 5 sec. In some time keycloak.authenticated states is false. App is redirecting to login page where understanding that token is valid. I think that depends of browsers setting or plugins because I don’t have it before update Safari to new version. However, my colleague has that problem from starting project

`import Vue from ‘vue’; import App from ‘./App.vue’; import store from ‘./store’; import router from ‘./router’; import VueKeyCloak from ‘@dsb-norge/vue-keycloak-js’; import { initAxios, vuetify } from ‘./plugins’; import i18n from ‘./i18n’;

Vue.config.productionTip = false;

let keycloak = null;

Vue.use(VueKeyCloak, { config: { url: process.env.VUE_APP_KEYCLOAK_URL, realm: process.env.VUE_APP_KEYCLOAK_REALM, clientId: process.env.VUE_APP_KEYCLOAK_CLIENT_ID, }, init: { onLoad: ‘login-required’, }, onReady: kc => { keycloak = window.keycloak = kc; initKeycloak() .then(() => initAxios(kc.token)) .then(initApp) .catch(authenticate); }, });

function initApp() { new Vue({ store, router, vuetify, i18n, render: h => h(App), }).$mount(‘#app’); }

function initKeycloak() { return new Promise((resolve, reject) => { if (!keycloak.authenticated) reject(Error(‘401’)); else { protectRoutes(); resolve(); } }); }

function protectRoutes() { router.beforeEach((to, from, next) => { keycloak.authenticated ? next() : authenticate(); }); }

function authenticate() { if (keycloak.authenticated) return; window.location.replace(keycloak.createLoginUrl()); } `

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
UncleViccommented, Sep 30, 2020

I solved it Refresh there is when Third-Party Cookie were blocked.

0reactions
lewis-ingcommented, Oct 19, 2020

Thx,@UncleVic And nlien,I figure out it,I check the vue-keycloak-js of doc and then view keycloak-js of doc,keycloak-js default 5s to refresh,So I setting checkLoginIframe:false for the configuration of man.js, To disable check login iframe, i still think to setting checkLoginIframe:true then it’s check you sso for you all system on you browse. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite Scroll with Refresh Every 5 Seconds - DataTables
Hi, I am trying to setup my datatable to sort of be an infinite scroll with server side processing refreshing the data every...
Read more >
jquery - Loop every five seconds in Javascript - Stack Overflow
that updates an image every five seconds, for a total of 15 seconds (so three loops), and then quits. It should go like...
Read more >
Infinite Refresh | WordPress.org
If a visitor visits your site and, after that, you initiate a refresh, it will be a maximum of 30 seconds before their...
Read more >
Refresh A Gridview every 5 seconds without page post back
Hi, Im trying to work out how to automatically refresh a gridview every 5 seconds. Im currently using masterpages in my site so...
Read more >
Repeat a Unix command every x seconds forever
PS: Maybe a better way to do this would be to generalize repeat to take both the number of times to repeat (with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found