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);
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){

View file

@ -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, {

View file

@ -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: '/' })
}
},

View file

@ -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'