diff --git a/package.json b/package.json
index 44f14fa6..eb2654f9 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,6 @@
"prettier": "3.0.3",
"prettier-plugin-tailwindcss": "0.5.6",
"tailwindcss": "3.3.4",
- "vite": "4.5.0"
+ "vite": "^4.5.14"
}
-}
\ No newline at end of file
+}
diff --git a/public/img/background.jpg b/public/img/background.jpg
new file mode 100644
index 00000000..fb14759e
Binary files /dev/null and b/public/img/background.jpg differ
diff --git a/public/img/pattern.png b/public/img/pattern.png
deleted file mode 100644
index 2b34e46f..00000000
Binary files a/public/img/pattern.png and /dev/null differ
diff --git a/src/api/axiosConfig.js b/src/api/axiosConfig.js
new file mode 100644
index 00000000..727b79ee
--- /dev/null
+++ b/src/api/axiosConfig.js
@@ -0,0 +1,28 @@
+import axios from "axios";
+
+
+const apiClient = axios.create({
+ baseURL: "https://localhost:7093/api",
+});
+
+
+apiClient.interceptors.request.use(
+ (config) => {
+
+ const token = localStorage.getItem("authToken");
+
+
+ if (token) {
+
+ config.headers.Authorization = `Bearer ${token}`;
+ }
+
+ return config;
+ },
+ (error) => {
+
+ return Promise.reject(error);
+ }
+);
+
+export default apiClient;
\ No newline at end of file
diff --git a/src/pages/auth/index.js b/src/pages/auth/index.js
index ca1bbcb6..425a5351 100644
--- a/src/pages/auth/index.js
+++ b/src/pages/auth/index.js
@@ -1,2 +1,2 @@
export * from "@/pages/auth/sign-in";
-export * from "@/pages/auth/sign-up";
+
diff --git a/src/pages/auth/sign-in.jsx b/src/pages/auth/sign-in.jsx
index 3b3da41a..e24defe7 100644
--- a/src/pages/auth/sign-in.jsx
+++ b/src/pages/auth/sign-in.jsx
@@ -1,126 +1,108 @@
-import {
- Card,
- Input,
- Checkbox,
- Button,
- Typography,
-} from "@material-tailwind/react";
-import { Link } from "react-router-dom";
-
+import React, { useState } from "react"; // YENİ: useState eklendi
+import { Card, Input, Button, Typography } from "@material-tailwind/react";
+import { Link, useNavigate } from "react-router-dom"; // YENİ: useNavigate eklendi
export function SignIn() {
+ const [username, setUsername] = useState("");
+ const [password, setPassword] = useState("");
+ const navigate = useNavigate();
+
+
+ const handleSignIn = async () => {
+ const loginData = {
+ username: username,
+ password: password,
+ };
+
+ try {
+ const response = await fetch("https://localhost:7093/api/Auth/Login", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(loginData),
+ });
+
+ if (response.ok) {
+ const token = await response.text();
+
+
+ localStorage.setItem("authToken", token);
+ console.log("Giriş Başarılı!");
+ navigate("/dashboard/home");
+ } else {
+ alert("Kullanıcı adı veya şifre hatalı!");
+ }
+ } catch (error) {
+ console.error("Sunucuya bağlanırken bir hata oluştu:", error);
+ alert("Sunucuya bağlanılamadı.");
+ }
+ };
+
return (
-
-
|
+
- {options.map(({ checked, label }) => (
-
-
+ |
))}
-
-
- |||
|---|---|---|---|
|
|
+
+ {/* Araç Plakası */}
+
|
+
+ {/* Telefon */}
+
|
+
+ {/* İşlem butonları alt alta ve sağa hizalı */}
+
+
+
+
-
-
-
+
- {members.map(({ img, name }, key) => (
-
-
-
- )
- )}
- |
+