-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add authentication [WIP] #5
base: dev
Are you sure you want to change the base?
Conversation
@anurag6569201 things for you bro
|
@punitkr03 can you please review the structure? i personally don't agree with assets/pages/ form of the website, we can do better with components and usual structure of a react project. Also any other improvement in the code if you'd like to mention |
commit 1cfd32a also restructures the app. |
We also need to think about transitions between pages now, simply loading up a endpoint won't suffice, need to make it smoother! |
The structure is not a standard practice. assets directory is meant for strictly media and you may include fonts there like |
@@ -0,0 +1,23 @@ | |||
import { Navigate } from 'react-router-dom'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look into the use of <Outlet />
component from react-router-dom here. It simplifies routing in protected routes.
import { useLocalStorage} from "./useLocalStorage"; | ||
|
||
|
||
interface AuthContextType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the types to a different directory named types
to improve consistency and import the types from there.
import { useAuth } from "../../hooks/useAuth"; | ||
import './login.css'; | ||
|
||
interface LoginFormInputs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the same with these types.
import emailIcon from '/public/images/register/email.png'; | ||
import { OTPInput, SlotProps } from "input-otp"; | ||
// Define types for our form data | ||
interface UserFormData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the type from here too.
[AUTH MEGATHREAD]
Currently WIP
This PR aims to achieve authentication functionality, along with identification in the gc-web app of the project.
Here are the key features this PR is aiming to achieving:-
Login Page
Register Page
There's also the OTP page, Verify OTP, Add username and Enter password pages that are already present, but haven't achieved functionality.
edit 1AM 28-12-2024: add smoother transitions requirements.