diff --git a/frontend/src/store/auth.js b/frontend/src/store/auth.js index a4747a05..5563acc7 100644 --- a/frontend/src/store/auth.js +++ b/frontend/src/store/auth.js @@ -68,6 +68,21 @@ export default { dispatch('closeAuthModal'); }, + async verifyToken({commit}, data) { + await HttpService.post('/user/token/verify', data, async (res) => { + const success = res.status == 200; + + if (!success) { + Vue.notify({ + title: "Authentication", + text: "Your login session has expired. Please log in again", + type: "info" + }); + + commit('logout'); + } + }); + }, register(store, data) { return new Promise((resolve) => HttpService.post('/user/register', data, () => { Vue.notify({