Skip to content

Commit

Permalink
fix: fixed pocketbase url 127.0.0.1 (#13)
Browse files Browse the repository at this point in the history
The base url for pocketbase client is hardcoded to be 127.0.0.1, now removed, use default.
  • Loading branch information
HuakunShen authored Dec 28, 2024
1 parent 34aa0e6 commit bc8ba27
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions apps/web/src/lib/pb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import PocketBase from 'pocketbase';
import type { TypedPocketBase } from './pocketbase-types';
import { PUBLIC_PB_URL } from '$env/static/public';

export const pb = new PocketBase(PUBLIC_PB_URL) as TypedPocketBase;
export const pb = new PocketBase() as TypedPocketBase;
1 change: 0 additions & 1 deletion apps/web/src/lib/stores/hosts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PUBLIC_PB_URL } from '$env/static/public';
import { pb } from '$lib/pb';
import type { HostsRecord, RecordIdString } from '$lib/pocketbase-types';
import { toast } from 'svelte-sonner';
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/routes/auth/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { Button, buttonVariants } from '$lib/components/ui/button/index.js';
import { PUBLIC_PB_URL } from '$env/static/public';
import * as Card from '$lib/components/ui/card/index.js';
import { Input } from '$lib/components/ui/input/index.js';
import { Label } from '$lib/components/ui/label/index.js';
Expand All @@ -9,6 +8,7 @@
import { toast } from 'svelte-sonner';
import * as Popover from '$lib/components/ui/popover/index.js';
import { goto } from '$app/navigation';
import { page } from '$app/state';
let email = $state('');
let password = $state('');
Expand Down Expand Up @@ -39,8 +39,7 @@
<form onsubmit={login}>
<Card.Header>
<Card.Title>Login</Card.Title>
<Card.Description
class="flex items-center justify-between"
<Card.Description class="flex items-center justify-between"
>Login to your account

<Popover.Root>
Expand All @@ -51,7 +50,8 @@
<Card.Description
>Account can only be created by admin from <a
target="_blank"
href={`${PUBLIC_PB_URL}/_/`}>{PUBLIC_PB_URL}/_/</a
href={`${page.url.protocol}//${page.url.host}/_/`}
>{page.url.protocol}//{page.url.host}/_/</a
>
</Card.Description>
</Popover.Content>
Expand Down

0 comments on commit bc8ba27

Please sign in to comment.