From 4017bd40852ee565ec1c159e997d92dc964baf83 Mon Sep 17 00:00:00 2001 From: supertiger1234 Date: Thu, 29 Aug 2019 18:19:05 +0100 Subject: [PATCH] changed authentication method --- src/components/app/relationships/RecentFriends.vue | 5 +++-- src/router.js | 10 +--------- src/store/modules/socketIOModule.js | 9 ++++++++- src/utils/changelog.js | 12 +++++++++++- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/app/relationships/RecentFriends.vue b/src/components/app/relationships/RecentFriends.vue index a089719..051b33d 100644 --- a/src/components/app/relationships/RecentFriends.vue +++ b/src/components/app/relationships/RecentFriends.vue @@ -29,8 +29,9 @@ export default { const keys = Object.keys(json); let result = []; keys.forEach(function(key){ - if (json[key].recipients.length > 0 && !json[key].servers) - result.push(json[key]); + console.log(json[key]) + if (json[key].recipients && json[key].recipients.length > 0 && !json[key].servers) + result.push(json[key]); }); result.sort(function(a, b){ diff --git a/src/router.js b/src/router.js index c468668..1891be4 100644 --- a/src/router.js +++ b/src/router.js @@ -63,15 +63,7 @@ export const router = new VueRouter({ Vue.use( VueSocketio, - io(config.socketIP, { - transportOptions: { - polling: { - extraHeaders: { - authorization: localStorage.getItem("hauthid") - } - } - } - }), + io(config.socketIP), { store } ); Vue.use(VueMq, { diff --git a/src/store/modules/socketIOModule.js b/src/store/modules/socketIOModule.js index 5c70e7a..ceb2844 100644 --- a/src/store/modules/socketIOModule.js +++ b/src/store/modules/socketIOModule.js @@ -9,10 +9,17 @@ const state = { } const actions = { + socket_authErr(context){ + context.dispatch('logout') + router.push({ path: '/' }) + }, + socket_connect() { + this._vm.$socket.emit('authentication', {token: localStorage.getItem("hauthid")}) + }, socket_error(context, error) { // if the token is invalid. if (error === "Authentication error") { - context.commit('logout') + context.dispatch('logout') router.push({ path: '/' }) } }, diff --git a/src/utils/changelog.js b/src/utils/changelog.js index 701e7f2..36491bd 100644 --- a/src/utils/changelog.js +++ b/src/utils/changelog.js @@ -14,12 +14,22 @@ const config = [ + { + version: 6.6, + title: "Performance improvements", + shortTitle: "", + date: "29/08/2019", + headColor: "rgba(25, 130, 255, 0.77)", + new: ['Sneak peak of the new "Explore" tab :D (Unfinished)'], + fix: [ + 'Improved backend code. This should improve performance.', + ], + }, { version: 6.5, title: "Bug fixes", shortTitle: "", date: "22/08/2019", - headColor: "rgba(25, 130, 255, 0.77)", fix: [ 'Fixed a bug where when being scrolled up, new messages would cause it to not load more.', 'Fixed a bug where scroll to bottom button wouldnt work'