From 9994c61f8f2a0292a6a8623984949ef453216b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 21 May 2021 13:33:05 +0200 Subject: [PATCH] fix login page --- packages/builder/src/pages/builder/auth/login.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index 0f125604b2..076813b6e9 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -9,7 +9,7 @@ Layout, notifications, } from "@budibase/bbui" - import { goto } from "@roxi/routify" + import { goto, params } from "@roxi/routify" import { auth, organisation } from "stores/portal" import GoogleButton from "./_components/GoogleButton.svelte" @@ -26,7 +26,12 @@ if ($auth?.user?.forceResetPassword) { $goto("./reset") } else { - $goto("../portal") + if ($params["?returnUrl"]) { + window.location = decodeURIComponent($params["?returnUrl"]) + } else { + notifications.success("Logged in successfully") + $goto("../portal") + } } } catch (err) { console.error(err)