feat: allow api based auth

This commit is contained in:
Shivam Mishra
2025-05-12 17:35:06 +05:30
parent 4ecc92ad6d
commit a97cf6e4ad
3 changed files with 11 additions and 1 deletions

View File

@@ -9,6 +9,11 @@ import {
export default {
validityCheck() {
if (this.hasAuthToken()) {
const urlData = endPoints('profileUpdate');
return axios.get(urlData.url);
}
const urlData = endPoints('validityCheck');
return axios.get(urlData.url);
},
@@ -31,6 +36,10 @@ export default {
hasAuthCookie() {
return !!Cookies.get('cw_d_session_info');
},
hasAuthToken() {
// eslint-disable-next-line no-underscore-dangle
return !!window.__WOOT_ACCESS_TOKEN__;
},
getAuthData() {
if (this.hasAuthCookie()) {
const savedAuthInfo = Cookies.get('cw_d_session_info');