snowballtools-base/packages/frontend
Vivian Phung b261e7e436
Feat: Access Code Authentication Flow (#211)
## What changed?

This Pull Request introduces an access code validation feature to the authentication process. Changes encompass backend route for access code validation, new frontend components for handling access code input, and integration of the access code verification in the signup flow.

### Backend:
- Added POST `/accesscode` route in `auth.ts` for validating access codes.

### Frontend:
- Created `AccessCode` component for access code input and validation.
- Added `AccessSignUp` component that integrates access code verification before signup.
- Updated `SignUp` component to check for valid access code on mount.
- Modified `SnowballAuth` to use new `AccessSignUp` instead of `SignUp`.
- Added `verifyAccessCode` utility function for code verification API call.

## How to test?
1. Run the backend and frontend projects.
2. Navigate to the signup page. You should be prompted to enter an access code.
3. Enter the code `444444` and proceed. Any other code should display an error message.
4. Verify that valid access code routes to the signup component.

## Why make this change?

This change improves authentication by adding an extra layer of security through access code verification.
2024-06-21 21:10:31 -04:00
..
.storybook storybook config domains and react dom context 2024-05-14 20:07:46 +00:00
public format prettier 2024-05-09 16:18:52 -04:00
src Feat: Access Code Authentication Flow (#211) 2024-06-21 21:10:31 -04:00
.env.example env example fix 2024-05-09 14:04:28 -04:00
.eslintrc.cjs storybook 2024-05-09 16:22:03 -04:00
.gitignore storybook 2024-05-09 16:22:03 -04:00
.node-version Switch from cra to vite 2024-04-11 21:48:58 -05:00
.prettierignore Add dist/ to .prettierignore (#195) 2024-05-22 14:50:37 -04:00
.prettierrc.json Create react app with tailwind, typescript, eslint and prettier (#4) 2023-12-08 10:50:55 +05:30
chromatic.config.json storybook 2024-05-09 16:22:03 -04:00
index.html Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
package.json [1/n][Storybook] Settings (#72) 2024-05-16 20:33:33 -04:00
postcss.config.js Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
README.md Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
reload-dev.sh Fix dev script 2024-05-02 15:47:23 -05:00
tailwind.config.js fix duplicate styling (#67) 2024-05-16 20:16:31 -04:00
tsconfig.json resolve aliases 2024-05-14 13:27:23 -04:00
tsconfig.node.json Switch from cra to vite 2024-04-11 21:48:58 -05:00
vite.config.ts Log commit hash 2024-06-04 15:56:52 -05:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
export default {
  // other rules...
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    project: ['./tsconfig.json', './tsconfig.node.json'],
    tsconfigRootDir: __dirname,
  },
};
  • Replace plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked or plugin:@typescript-eslint/strict-type-checked
  • Optionally add plugin:@typescript-eslint/stylistic-type-checked
  • Install eslint-plugin-react and add plugin:react/recommended & plugin:react/jsx-runtime to the extends list