Skip to content

Jack Miller#92

Open
jdm1991 wants to merge 2 commits intoboolean-uk:mainfrom
jdm1991:main
Open

Jack Miller#92
jdm1991 wants to merge 2 commits intoboolean-uk:mainfrom
jdm1991:main

Conversation

@jdm1991
Copy link
Copy Markdown

@jdm1991 jdm1991 commented Jan 29, 2024

No description provided.

Comment thread src/client/App.jsx

const handleRegister = async ({ username, password }) => {
try {
const response = await fetch(`http://localhost:4000/user/register`, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we're making two, basically identical, post requests - it would be a good idea to make a function handle the object creation/sending the fetch request. That way we can save on code duplication.

const prisma = new PrismaClient();

const jwtSecret = 'mysecret';
const jwtSecret = "mysecret";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good as an environment variable. Otherwise, someone could gain access to your code and then would be able to decode your tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants