budibase/packages/builder/src/builderStore/cookies.js

17 lines
386 B
JavaScript
Raw Normal View History

export const Cookies = {
Auth: "budibase:auth",
CurrentApp: "budibase:currentapp",
}
export function getCookie(cookieName) {
2021-05-03 09:31:09 +02:00
return document.cookie.split(";").some((cookie) => {
return cookie.trim().startsWith(`${cookieName}=`)
})
}
export function removeCookie(cookieName) {
if (getCookie(cookieName)) {
document.cookie = `${cookieName}=; Max-Age=-99999999;`
}
}