mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
17 lines
426 B
TypeScript
17 lines
426 B
TypeScript
export const useIsLoggedIn = () => {
|
|
const isLoggedIn = useState<boolean>(
|
|
'isLoggedIn',
|
|
() => localStorage.getItem('isLoggedIn') === 'true',
|
|
)
|
|
|
|
return computed({
|
|
get: () => isLoggedIn.value,
|
|
set: (value) => {
|
|
isLoggedIn.value = value
|
|
localStorage.setItem('isLoggedIn', value.toString())
|
|
},
|
|
})
|
|
}
|
|
|
|
export const useRedirectUrl = () =>
|
|
useState<string | null>('redirectUrl', () => null)
|