diff --git a/.env b/.env index 236e545..ad82eb2 100644 --- a/.env +++ b/.env @@ -1,6 +1 @@ -# .env -VITE_API_URL=http://localhost:8000 - -# You can also create environment-specific files: -# .env.development -# .env.production +VITE_API_URL=http://127.0.0.1:8000 diff --git a/src/components/admin/Setting.tsx b/src/components/admin/Setting.tsx index f298333..d321580 100644 --- a/src/components/admin/Setting.tsx +++ b/src/components/admin/Setting.tsx @@ -108,16 +108,9 @@ export default function UserCreate() {
-

Account Settings

-

Manage your profile and security preferences

+

Manage your profile and security preferences

{/* Current user information card */} diff --git a/src/components/admin/users/UserCreate.tsx b/src/components/admin/users/UserCreate.tsx index 6fa3290..272c3cb 100644 --- a/src/components/admin/users/UserCreate.tsx +++ b/src/components/admin/users/UserCreate.tsx @@ -70,16 +70,9 @@ export default function UserCreate() {
-

Create New User

-

Add a new administrator to the system

+

Add a new administrator to the system

diff --git a/src/components/home/HeroSection.tsx b/src/components/home/HeroSection.tsx index 3f37006..74301ce 100644 --- a/src/components/home/HeroSection.tsx +++ b/src/components/home/HeroSection.tsx @@ -421,22 +421,22 @@ export default function Home() { > Search Database - + Contribute a Story - + Photo Gallery Research Help - + Volunteer - + Support Us @@ -446,22 +446,22 @@ export default function Home() {

Resources

@@ -556,7 +556,7 @@ export default function Home() { Accessibility - + Admin diff --git a/src/services/apiService.ts b/src/services/apiService.ts index c280f92..aad10fc 100644 --- a/src/services/apiService.ts +++ b/src/services/apiService.ts @@ -37,6 +37,10 @@ class ApiService { // --- AUTH --- async login(params: { email: string; password: string }) { + // First get CSRF cookie + await this.api.get("/sanctum/csrf-cookie"); + + // Then login return this.api.post("/api/login", params).then((res) => { console.log("Token:", res.data.token); localStorage.setItem("token", res.data.token); @@ -45,6 +49,7 @@ class ApiService { }); } + async register(params: { name: string; email: string; password: string }) { return this.api.post("/api/register", params).then((res) => res.data);