From 258fdaff579915d755f3270708e9d142e9e61360 Mon Sep 17 00:00:00 2001 From: Arslan Kamchybekov Date: Wed, 11 Sep 2024 15:23:52 -0500 Subject: [PATCH] frontend auth setup --- frontend/next.config.mjs | 34 +++++++++++++++++++++++++++++++--- frontend/src/pages/index.tsx | 9 +++++---- frontend/src/pages/signin.tsx | 10 ++++++++++ frontend/src/pages/signup.tsx | 10 ++++++++++ 4 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 frontend/src/pages/signin.tsx create mode 100644 frontend/src/pages/signup.tsx diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 4678774..48337c7 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -1,4 +1,32 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; - -export default nextConfig; +const nextConfig = { + async headers() { + return [ + { + // Apply these headers to all routes in your application + source: '/(.*)', + headers: [ + { + key: 'Access-Control-Allow-Credentials', + value: 'true', + }, + { + key: 'Access-Control-Allow-Origin', + value: '*', // Replace with your allowed origin + }, + { + key: 'Access-Control-Allow-Methods', + value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT', + }, + { + key: 'Access-Control-Allow-Headers', + value: 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, Authorization', + }, + ], + }, + ]; + }, + }; + + export default nextConfig; + \ No newline at end of file diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index f2ae1d7..af580c8 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,10 +1,11 @@ - +import React from 'react'; const Home: React.FC = () => { + return ( -
-

Home

-
+ <> + + ); } diff --git a/frontend/src/pages/signin.tsx b/frontend/src/pages/signin.tsx new file mode 100644 index 0000000..f9a8f11 --- /dev/null +++ b/frontend/src/pages/signin.tsx @@ -0,0 +1,10 @@ + +const SignIn: React.FC = () => { + return ( + <> +

Sign In

+ + ); +} + +export default SignIn; \ No newline at end of file diff --git a/frontend/src/pages/signup.tsx b/frontend/src/pages/signup.tsx new file mode 100644 index 0000000..7b3d9b3 --- /dev/null +++ b/frontend/src/pages/signup.tsx @@ -0,0 +1,10 @@ + +const SignUp: React.FC = () => { + return ( + <> +

Sign Up

+ + ); +} + +export default SignUp; \ No newline at end of file