changed authentication method

This commit is contained in:
supertiger1234 2019-08-29 18:19:05 +01:00
parent 0889a08ee1
commit 4017bd4085
4 changed files with 23 additions and 13 deletions

View file

@ -29,8 +29,9 @@ export default {
const keys = Object.keys(json); const keys = Object.keys(json);
let result = []; let result = [];
keys.forEach(function(key){ keys.forEach(function(key){
if (json[key].recipients.length > 0 && !json[key].servers) console.log(json[key])
result.push(json[key]); if (json[key].recipients && json[key].recipients.length > 0 && !json[key].servers)
result.push(json[key]);
}); });
result.sort(function(a, b){ result.sort(function(a, b){

View file

@ -63,15 +63,7 @@ export const router = new VueRouter({
Vue.use( Vue.use(
VueSocketio, VueSocketio,
io(config.socketIP, { io(config.socketIP),
transportOptions: {
polling: {
extraHeaders: {
authorization: localStorage.getItem("hauthid")
}
}
}
}),
{ store } { store }
); );
Vue.use(VueMq, { Vue.use(VueMq, {

View file

@ -9,10 +9,17 @@ const state = {
} }
const actions = { 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) { socket_error(context, error) {
// if the token is invalid. // if the token is invalid.
if (error === "Authentication error") { if (error === "Authentication error") {
context.commit('logout') context.dispatch('logout')
router.push({ path: '/' }) router.push({ path: '/' })
} }
}, },

View file

@ -14,12 +14,22 @@
const config = [ 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, version: 6.5,
title: "Bug fixes", title: "Bug fixes",
shortTitle: "", shortTitle: "",
date: "22/08/2019", date: "22/08/2019",
headColor: "rgba(25, 130, 255, 0.77)",
fix: [ fix: [
'Fixed a bug where when being scrolled up, new messages would cause it to not load more.', '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' 'Fixed a bug where scroll to bottom button wouldnt work'