Spaces:
Running
on
Inf2
Running
on
Inf2
fix: let users explore app without signing
Browse files- src/hooks.server.ts +1 -0
- src/lib/components/DisclaimerModal.svelte +20 -18
src/hooks.server.ts
CHANGED
|
@@ -249,6 +249,7 @@ export const handle: Handle = async ({ event, resolve }) => {
|
|
| 249 |
if (
|
| 250 |
!event.url.pathname.startsWith(`${base}/login`) &&
|
| 251 |
!event.url.pathname.startsWith(`${base}/admin`) &&
|
|
|
|
| 252 |
!["GET", "OPTIONS", "HEAD"].includes(event.request.method)
|
| 253 |
) {
|
| 254 |
if (
|
|
|
|
| 249 |
if (
|
| 250 |
!event.url.pathname.startsWith(`${base}/login`) &&
|
| 251 |
!event.url.pathname.startsWith(`${base}/admin`) &&
|
| 252 |
+
!event.url.pathname.startsWith(`${base}/settings`) &&
|
| 253 |
!["GET", "OPTIONS", "HEAD"].includes(event.request.method)
|
| 254 |
) {
|
| 255 |
if (
|
src/lib/components/DisclaimerModal.svelte
CHANGED
|
@@ -29,27 +29,29 @@
|
|
| 29 |
</p>
|
| 30 |
|
| 31 |
<div class="flex w-full flex-col items-center gap-2">
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
}
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
| 48 |
{:else}
|
| 49 |
-
|
| 50 |
{/if}
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
{#if $page.data.loginEnabled}
|
| 54 |
<form action="{base}/login" target="_parent" method="POST" class="w-full">
|
| 55 |
<button
|
|
|
|
| 29 |
</p>
|
| 30 |
|
| 31 |
<div class="flex w-full flex-col items-center gap-2">
|
| 32 |
+
<button
|
| 33 |
+
class="w-full justify-center rounded-full border-2 border-gray-300 bg-black px-5 py-2 text-lg font-semibold text-gray-100 transition-colors hover:bg-gray-900"
|
| 34 |
+
class:bg-white={$page.data.loginEnabled}
|
| 35 |
+
class:text-gray-800={$page.data.loginEnabled}
|
| 36 |
+
class:hover:bg-slate-100={$page.data.loginEnabled}
|
| 37 |
+
on:click|preventDefault|stopPropagation={() => {
|
| 38 |
+
if (!cookiesAreEnabled()) {
|
| 39 |
+
window.open(window.location.href, "_blank");
|
| 40 |
+
}
|
|
|
|
| 41 |
|
| 42 |
+
$settings.ethicsModalAccepted = true;
|
| 43 |
+
}}
|
| 44 |
+
>
|
| 45 |
+
{#if $page.data.loginEnabled}
|
| 46 |
+
{#if $page.data.guestMode}
|
| 47 |
+
Continue as guest
|
| 48 |
{:else}
|
| 49 |
+
Explore the app
|
| 50 |
{/if}
|
| 51 |
+
{:else}
|
| 52 |
+
Start chatting
|
| 53 |
+
{/if}
|
| 54 |
+
</button>
|
| 55 |
{#if $page.data.loginEnabled}
|
| 56 |
<form action="{base}/login" target="_parent" method="POST" class="w-full">
|
| 57 |
<button
|