mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-24 23:15:11 +00:00
feat: allow api based auth
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user