add test coverage for auth utils

This commit is contained in:
Jake McDermott
2019-06-14 09:41:49 -04:00
parent 4aa4490933
commit e35f7acd05
4 changed files with 23 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
// eslint-disable-next-line import/prefer-default-export
export function isAuthenticated () {
const parsed = (`; ${document.cookie}`).split('; userLoggedIn=');
export function isAuthenticated (cookie) {
const parsed = (`; ${cookie}`).split('; userLoggedIn=');
if (parsed.length === 2) {
return parsed.pop().split(';').shift() === 'true';
}