fix
This commit is contained in:
@@ -19,7 +19,7 @@ type UserSessionState struct {
|
|||||||
func (s *Service) UserSessionState(ctx context.Context, userID uuid.UUID) (UserSessionState, error) {
|
func (s *Service) UserSessionState(ctx context.Context, userID uuid.UUID) (UserSessionState, error) {
|
||||||
var st UserSessionState
|
var st UserSessionState
|
||||||
err := s.Pool.QueryRow(ctx, `
|
err := s.Pool.QueryRow(ctx, `
|
||||||
SELECT is_active, session_version
|
SELECT COALESCE(is_active, false), COALESCE(session_version, 0)
|
||||||
FROM users
|
FROM users
|
||||||
WHERE id = $1`, userID).Scan(&st.Active, &st.Version)
|
WHERE id = $1`, userID).Scan(&st.Active, &st.Version)
|
||||||
if isUndefinedColumn(err) {
|
if isUndefinedColumn(err) {
|
||||||
|
|||||||
@@ -308,11 +308,9 @@ func (s *Server) handleMe(w http.ResponseWriter, r *http.Request) {
|
|||||||
if accessErr == nil && access.FullAdmin && access.Role == auth.StaffRoleAdmin {
|
if accessErr == nil && access.FullAdmin && access.Role == auth.StaffRoleAdmin {
|
||||||
staffTenantSwitch = true
|
staffTenantSwitch = true
|
||||||
all, listErr := s.Auth.ListCompanies(r.Context(), 500)
|
all, listErr := s.Auth.ListCompanies(r.Context(), 500)
|
||||||
if listErr != nil {
|
if listErr == nil {
|
||||||
Error(w, http.StatusInternalServerError, "failed to load companies")
|
companies = all
|
||||||
return
|
|
||||||
}
|
}
|
||||||
companies = all
|
|
||||||
}
|
}
|
||||||
cidStr := s.Sessions.GetString(r.Context(), auth.SessionCompanyIDKey)
|
cidStr := s.Sessions.GetString(r.Context(), auth.SessionCompanyIDKey)
|
||||||
homeStr := strings.TrimSpace(s.Sessions.GetString(r.Context(), auth.SessionStaffHomeCompanyKey))
|
homeStr := strings.TrimSpace(s.Sessions.GetString(r.Context(), auth.SessionStaffHomeCompanyKey))
|
||||||
|
|||||||
@@ -60,8 +60,6 @@
|
|||||||
|
|
||||||
<a
|
<a
|
||||||
href={CTA_DATA.ctaButton.href}
|
href={CTA_DATA.ctaButton.href}
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="rounded-md bg-surface px-5 py-3 text-sm font-semibold text-text shadow-sm transition hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
class="rounded-md bg-surface px-5 py-3 text-sm font-semibold text-text shadow-sm transition hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
||||||
>
|
>
|
||||||
{i18n.t("home.cta.apply")} <span aria-hidden="true">→</span>
|
{i18n.t("home.cta.apply")} <span aria-hidden="true">→</span>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { DEMO_BOOKING_URL } from "$lib/site";
|
|
||||||
import { PROCESS_STEPS } from "./data";
|
import { PROCESS_STEPS } from "./data";
|
||||||
import { i18n } from "$lib/i18n";
|
import { i18n } from "$lib/i18n";
|
||||||
|
|
||||||
@@ -113,9 +112,7 @@
|
|||||||
|
|
||||||
<div class="mt-24 text-center">
|
<div class="mt-24 text-center">
|
||||||
<a
|
<a
|
||||||
href={DEMO_BOOKING_URL}
|
href="/register"
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="inline-flex items-center rounded-md bg-primary px-5 py-3 text-sm font-semibold text-primary-foreground shadow-sm transition hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
class="inline-flex items-center rounded-md bg-primary px-5 py-3 text-sm font-semibold text-primary-foreground shadow-sm transition hover:opacity-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
||||||
>
|
>
|
||||||
{i18n.t("home.how.apply")}
|
{i18n.t("home.how.apply")}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { DEMO_BOOKING_URL } from "$lib/site";
|
|
||||||
import { i18n } from "$lib/i18n";
|
import { i18n } from "$lib/i18n";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -46,9 +45,7 @@
|
|||||||
{i18n.t("home.hero.learnMore")}
|
{i18n.t("home.hero.learnMore")}
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href={DEMO_BOOKING_URL}
|
href="/register"
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="rounded-md border border-border bg-surface/70 px-4 py-2.5 text-sm leading-6 font-semibold text-text backdrop-blur-sm transition hover:bg-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
class="rounded-md border border-border bg-surface/70 px-4 py-2.5 text-sm leading-6 font-semibold text-text backdrop-blur-sm transition hover:bg-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
||||||
>
|
>
|
||||||
{i18n.t("home.hero.apply")} <span aria-hidden="true">→</span>
|
{i18n.t("home.hero.apply")} <span aria-hidden="true">→</span>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { DEMO_BOOKING_URL } from "$lib/site";
|
|
||||||
|
|
||||||
export type ProcessStep = {
|
export type ProcessStep = {
|
||||||
number: number;
|
number: number;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -206,7 +204,7 @@ export const CTA_DATA = {
|
|||||||
],
|
],
|
||||||
ctaButton: {
|
ctaButton: {
|
||||||
text: "Apply For Access",
|
text: "Apply For Access",
|
||||||
href: DEMO_BOOKING_URL
|
href: "/register"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
/** Shared public/marketing site constants (aligned with legacy Descrybe). */
|
/** Shared public/marketing site constants (aligned with legacy Descrybe). */
|
||||||
|
|
||||||
export const DEMO_BOOKING_URL = "https://calendly.com/tim-berce/descrybe-demo";
|
|
||||||
|
|
||||||
/** Auth routes — logged-out chrome with ThemeToggle (no dashboard shell). */
|
/** Auth routes — logged-out chrome with ThemeToggle (no dashboard shell). */
|
||||||
export const AUTH_PATHS = new Set([
|
export const AUTH_PATHS = new Set([
|
||||||
"/login",
|
"/login",
|
||||||
|
|||||||
@@ -20,13 +20,12 @@
|
|||||||
import AnalyticsHost from "$lib/components/AnalyticsHost.svelte";
|
import AnalyticsHost from "$lib/components/AnalyticsHost.svelte";
|
||||||
import CookieConsentBanner from "$lib/components/CookieConsentBanner.svelte";
|
import CookieConsentBanner from "$lib/components/CookieConsentBanner.svelte";
|
||||||
import { cookieConsent } from "$lib/cookie-consent.svelte";
|
import { cookieConsent } from "$lib/cookie-consent.svelte";
|
||||||
import { buttonClasses } from "$lib/components/ui";
|
|
||||||
import { browser } from "$app/environment";
|
import { browser } from "$app/environment";
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
import { page } from "$app/state";
|
import { page } from "$app/state";
|
||||||
import { api, isUnauthorized } from "$lib/api";
|
import { api, isUnauthorized } from "$lib/api";
|
||||||
import { safeInternalNext } from "$lib/safe-next";
|
import { safeInternalNext } from "$lib/safe-next";
|
||||||
import { AUTH_PATHS, DEMO_BOOKING_URL, MARKETING_PATHS } from "$lib/site";
|
import { AUTH_PATHS, MARKETING_PATHS } from "$lib/site";
|
||||||
import { theme } from "$lib/theme.svelte";
|
import { theme } from "$lib/theme.svelte";
|
||||||
import { ADMIN_SIDEBAR_WIDTH_CLASS, adminPageTitleKey } from "$lib/admin-nav";
|
import { ADMIN_SIDEBAR_WIDTH_CLASS, adminPageTitleKey } from "$lib/admin-nav";
|
||||||
import ThemeToggle from "$lib/components/ThemeToggle.svelte";
|
import ThemeToggle from "$lib/components/ThemeToggle.svelte";
|
||||||
@@ -270,19 +269,6 @@
|
|||||||
<div class="flex shrink-0 items-center gap-2">
|
<div class="flex shrink-0 items-center gap-2">
|
||||||
<LocaleSwitcher />
|
<LocaleSwitcher />
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
<a
|
|
||||||
href={DEMO_BOOKING_URL}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class={buttonClasses(
|
|
||||||
"default",
|
|
||||||
"default",
|
|
||||||
"shrink-0 rounded-md px-3 py-1.5 text-sm shadow-sm transition-opacity hover:opacity-90 sm:px-5 sm:py-2 sm:text-base"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<span class="sm:hidden">{i18n.t("site.demoShort")}</span>
|
|
||||||
<span class="hidden sm:inline">{i18n.t("site.bookDemo")}</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import { i18n } from "$lib/i18n";
|
import { i18n } from "$lib/i18n";
|
||||||
import { page } from "$app/state";
|
import { page } from "$app/state";
|
||||||
import { failureMessage } from "$lib/api";
|
import { failureMessage } from "$lib/api";
|
||||||
import { DEMO_BOOKING_URL } from "$lib/site";
|
|
||||||
import { submitSalesContact } from "$lib/sales-contact";
|
import { submitSalesContact } from "$lib/sales-contact";
|
||||||
import { notifySuccess, notifyApiError } from "$lib/notify";
|
import { notifySuccess, notifyApiError } from "$lib/notify";
|
||||||
import SiteHeader from "$lib/components/site/SiteHeader.svelte";
|
import SiteHeader from "$lib/components/site/SiteHeader.svelte";
|
||||||
@@ -87,14 +86,6 @@
|
|||||||
<CardDescription>{i18n.t("sales.contact.thanksBody")}</CardDescription>
|
<CardDescription>{i18n.t("sales.contact.thanksBody")}</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent class="flex flex-wrap gap-3">
|
<CardContent class="flex flex-wrap gap-3">
|
||||||
<a
|
|
||||||
href={DEMO_BOOKING_URL}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="inline-flex h-10 items-center justify-center rounded-md border border-border px-4 text-sm font-medium text-text transition-colors hover:bg-surface-muted"
|
|
||||||
>
|
|
||||||
{i18n.t("sales.contact.bookDemo")}
|
|
||||||
</a>
|
|
||||||
<a
|
<a
|
||||||
href="/pricing"
|
href="/pricing"
|
||||||
class="inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground"
|
class="inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground"
|
||||||
@@ -153,14 +144,6 @@
|
|||||||
<Button type="submit" disabled={!canSubmit}>
|
<Button type="submit" disabled={!canSubmit}>
|
||||||
{submitting ? i18n.t("sales.contact.submitting") : i18n.t("sales.contact.submit")}
|
{submitting ? i18n.t("sales.contact.submitting") : i18n.t("sales.contact.submit")}
|
||||||
</Button>
|
</Button>
|
||||||
<a
|
|
||||||
href={DEMO_BOOKING_URL}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
class="text-sm text-text-muted underline-offset-4 hover:text-link hover:underline"
|
|
||||||
>
|
|
||||||
{i18n.t("sales.contact.orBookDemo")}
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
import { apiFormError, fieldDescribedBy, fieldInvalid, parseBodyErrorCodes } from "$lib/api-form-error";
|
import { apiFormError, fieldDescribedBy, fieldInvalid, parseBodyErrorCodes } from "$lib/api-form-error";
|
||||||
import { i18n } from "$lib/i18n";
|
import { i18n } from "$lib/i18n";
|
||||||
import { safeInternalNext } from "$lib/safe-next";
|
import { safeInternalNext } from "$lib/safe-next";
|
||||||
|
import type { MeResponse } from "$lib/types";
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
AlertDescription,
|
AlertDescription,
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: { email, password }
|
body: { email, password }
|
||||||
});
|
});
|
||||||
|
await api<MeResponse>("/api/auth/me");
|
||||||
trackEvent("login", { method: "email" });
|
trackEvent("login", { method: "email" });
|
||||||
await goto(safeInternalNext(page.url.searchParams.get("next"), "/dashboard"));
|
await goto(safeInternalNext(page.url.searchParams.get("next"), "/dashboard"));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user