Skip to content

Commit

Permalink
more testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsong86 committed Nov 9, 2024
1 parent 23ed073 commit 04b3098
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/app/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Link from 'next/link';
import Image from 'next/image';

const apiUrl = process.env.NEXT_PUBLIC_API_URL;
console.log("API URL:", apiUrl);

const SignInPage: React.FC = () => {
const router = useRouter();
Expand All @@ -24,6 +25,7 @@ const SignInPage: React.FC = () => {
console.log("handleSignin triggered");

try {
console.log("Preparing to send POST request to", `${apiUrl}/signin`);
const response = await fetch(`${apiUrl}/signin`, {
method: 'POST',
headers: {
Expand All @@ -32,6 +34,7 @@ const SignInPage: React.FC = () => {
body: JSON.stringify({ email, password }),
credentials: 'include', // This ensures cookies are sent with the request
});
console.log("Response received:", response);

if (response.status === 429) {
throw new Error('Too many requests. Please try again later.');
Expand Down

0 comments on commit 04b3098

Please sign in to comment.