From 7b325435370e469705640f2a976ab7d3e6c96d89 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 25 Jan 2022 15:28:14 +0000 Subject: [PATCH] Use core CookieUtils in client library --- packages/client/src/components/ClientApp.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 65d3f67179..5bd5d2d46f 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -3,6 +3,7 @@ import { setContext, onMount } from "svelte" import { Layout, Heading, Body } from "@budibase/bbui" import ErrorSVG from "@budibase/frontend-core/assets/error.svg" + import { Constants, CookieUtils } from "@budibase/frontend-core" import Component from "./Component.svelte" import SDK from "sdk" import { @@ -63,9 +64,8 @@ } else { // The user is not logged in, redirect them to login const returnUrl = `${window.location.pathname}${window.location.hash}` - // TODO: reuse `Cookies` from builder when frontend-core is added - window.document.cookie = `budibase:returnurl=${returnUrl}; Path=/` - window.location = `/builder/auth/login` + CookieUtils.setCookie(Constants.Cookies.ReturnUrl, returnUrl) + window.location = "/builder/auth/login" } } }