Skip to content

Commit 4e44f00

Browse files
committed
Disable the Spark token refresh timer
1 parent bdd5f6e commit 4e44f00

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

resources/assets/js/spark.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ export default {
4242
this.loadDataForAuthenticatedUser();
4343
}
4444

45-
if (Spark.userId && Spark.usesApi) {
46-
this.refreshApiTokenEveryFewMinutes();
47-
}
48-
4945
Bus.$on('updateUser', function () {
5046
self.getUser();
5147
});
@@ -102,31 +98,6 @@ export default {
10298
this.getNotifications();
10399
},
104100

105-
106-
/**
107-
* Refresh the current API token every few minutes.
108-
*/
109-
refreshApiTokenEveryFewMinutes() {
110-
this.lastRefreshedApiTokenAt = moment();
111-
112-
window.sparkTokenRefreshInterval = setInterval(() => {
113-
if (moment().diff(this.lastRefreshedApiTokenAt, 'minutes') >= 4) {
114-
this.refreshApiToken();
115-
}
116-
}, 15000);
117-
},
118-
119-
120-
/**
121-
* Refresh the current API token.
122-
*/
123-
refreshApiToken() {
124-
this.lastRefreshedApiTokenAt = moment();
125-
126-
axios.put('/spark/token');
127-
},
128-
129-
130101
/*
131102
* Get the current user of the application.
132103
*/

0 commit comments

Comments
 (0)