useCookie typescript saying that Boolean should be a string, when it's a boolean

I have code that does:
const login() => {
  const isLoggedIn = useCookie('isLoggedIn')
  isLoggedIn.value = 'true'
}

definePageMeta({
  middleware: () => {
    const isLoggedIn = useCookie('isLoggedIn')
    if (isLoggedIn.value === 'true') {
      navigateTo('/page/')
    }
  }
})

Problem is,
isLoggedIn.value
actually returns a
Boolean
, not a string like TypeScript thinks πŸ™‚ So looks like something might be wrong with the docs for this πŸ‘€

How to fix it?
Literally this works:
if (isLoggedIn.value === true) {...}

But typescript says it's wrong.
Was this page helpful?