Migrate backend from PocketBase to Directus
Full cutover: auth, users, collection and friendships now run on Directus via @directus/sdk, with owner/visibility rules enforced by Directus permissions. - middleware: Directus session (directus_auth cookie) with token refresh - /login is Directus (email normalized to lowercase), new /register page (first/last name, username) backed by public registration - collection, friends and profile pages + all API endpoints ported; ownership and addressee-only accept/decline enforced by permissions - display names use first_name/last_name everywhere (nav, friends, profile) - PocketBase SDK, POCKETBASE_URL and pb_schema.json removed - README and compose updated for DIRECTUS_URL
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
<section>
|
||||
<form id="login-form" class="grid gap-4">
|
||||
<div role="group" class="field">
|
||||
<label for="username">Nom d'utilisateur</label>
|
||||
<label for="username">Email</label>
|
||||
<input
|
||||
class="input"
|
||||
type="text"
|
||||
type="email"
|
||||
id="username"
|
||||
name="username"
|
||||
placeholder="votre@email.com"
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
---
|
||||
const { pb } = Astro.locals;
|
||||
const user = pb.authStore.record;
|
||||
const initials = user
|
||||
? (user.name || user.email || "")
|
||||
.split(/[\s@.]+/)
|
||||
.filter(Boolean)
|
||||
.slice(0, 2)
|
||||
.map((s: string) => s[0].toUpperCase())
|
||||
.join("")
|
||||
: "";
|
||||
import { displayName, initials as userInitials } from "../lib/directus";
|
||||
|
||||
const user = Astro.locals.user;
|
||||
const initials = user ? userInitials(user) : "";
|
||||
---
|
||||
|
||||
<header
|
||||
@@ -130,7 +124,7 @@ const initials = user
|
||||
<span>{initials}</span>
|
||||
</span>
|
||||
<span class="hidden sm:inline ml-1 text-sm">
|
||||
{user.name || user.email}
|
||||
{displayName(user)}
|
||||
</span>
|
||||
<svg
|
||||
data-icon="inline-end"
|
||||
|
||||
Reference in New Issue
Block a user