Skip to content
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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

ujsquared
Copy link
Collaborator

@ujsquared ujsquared commented Dec 27, 2024

[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:-

  • Define Protected Roues
  • Implement localStorage usage
  • Implement login and token verification
  • Creating new account, and verification
  • Implement OTP fetching and verification
  • Styling for all needed pages
  • Smoother transitions between pages

Login Page



Register Page

Register

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.

@ujsquared
Copy link
Collaborator Author

@anurag6569201 things for you bro

  1. add fonts
  2. make the css for every page symmetric like the register page.
  3. pls add CSS for OTP page where every digit box of OTP with some animation.
  4. Look into css for every page I have made in general, i'm bad at it and i think you can do a crazy better job animating them than me. feel free to add libraries, just mention theme here before.

@ujsquared ujsquared requested a review from punitkr03 December 27, 2024 09:56
@ujsquared
Copy link
Collaborator Author

@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

@ujsquared
Copy link
Collaborator Author

commit 1cfd32a also restructures the app.
@zakhaev26 pls check

@ujsquared
Copy link
Collaborator Author

We also need to think about transitions between pages now, simply loading up a endpoint won't suffice, need to make it smoother!

@punitkr03
Copy link
Collaborator

@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

The structure is not a standard practice. assets directory is meant for strictly media and you may include fonts there like assets/fonts. The pages should be outside of the assets directory like this src/pages/Homepage.tsx.

apps/webview/src/App.tsx Show resolved Hide resolved
@@ -0,0 +1,23 @@
import { Navigate } from 'react-router-dom';
Copy link
Collaborator

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 {
Copy link
Collaborator

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 {
Copy link
Collaborator

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 {
Copy link
Collaborator

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.

@zakhaev26 zakhaev26 added the enhancement New feature or request label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants