Last active
July 4, 2017 16:13
-
-
Save 8lane/f33f416e80a47128e621eae8edcd7f6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isLoggedIn: (redirect=false) => { | |
return CMS.get({ | |
url: App.SiteURL + '/api/SessionActive/', | |
data: { | |
channelId: getDevice() === 'mobile' ? 2 : 1 | |
} | |
}).then(response => { | |
if (response.data || response.accessToken) { | |
return true; | |
} | |
return false; | |
}, error => { | |
if(error.status === '403' || error.status === 403) { | |
OpenLogin(); | |
return false; | |
} | |
if(redirect) { | |
OpenLogin(); | |
} | |
return false; | |
}) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment