From cda571c76d375581ea1d5bb665c02859e19cc945 Mon Sep 17 00:00:00 2001 From: rakema01 <99795534+rakema01@users.noreply.github.com> Date: Sun, 18 May 2025 19:41:52 +0000 Subject: [PATCH] Update auth.js --- frontend/src/store/auth.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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({