Giter Site home page Giter Site logo

ama-app's People

Contributors

hiteshchoudhary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ama-app's Issues

In get-message route

    if (!user || user.length === 0) {
        return Response.json(
            { success: false, message: 'User not found', },
            { status: 404 }
        );
    }
    here checking length of message is after aggregation pipeline 
    is creating error user-not found for new user

TS type error

MessageCard.tsx has a TS type error for line number 40 -
onMessageDelete(message._id);

Argument of type 'unknown' is not assignable to parameter of type 'string'.ts(2345)

  onMessageDelete(message._id as string);

OpenAiStrem is depritiated

there needs to be some changes in suggest-messages as openaistream has been depritiated also
vercel has removed some of the providers and updated whole document

Multiple Sign-In Requests Allowed Without Entering Credentials

Description: Currently, users are able to click the sign-in button multiple times without entering any credentials. This results in multiple requests being sent to the backend, potentially causing unnecessary load and processing.

Steps to Reproduce:

  • Visit the sign-in page.
  • Click the sign-in button multiple times without entering any credentials.
  • Observe multiple requests being sent to the backend.

Expected Behavior:
Users should only be able to submit the sign-in form once, and subsequent clicks on the sign-in button without entering credentials should not trigger additional requests.

Proposed Solution:
Implement client-side validation to disable the sign-in button until valid credentials are entered. This can help prevent multiple requests from being sent unintentionally. Additionally, consider adding visual feedback to indicate to the user that the sign-in process is underway.

My views:
As observed, the sign-in button remains active even if no credentials are entered. To address this, we can utilize React's useState hook to disable the button upon submission. By setting a state variable to track the submission status, we can prevent multiple submissions. Additionally, considering the usage of react-hook-form, we can leverage its formState.isDirty property to conditionally disable the button until valid credentials are entered.

for same email username is not changed issue in the signup route logic

in the signup route
if (existingUserByEmail) {
if (existingUserByEmail.isVerified) {
return Response.json(
{
success: false,
message: 'User already exists with this email',
},
{ status: 400 }
);
} else {
const hashedPassword = await bcrypt.hash(password, 10);
existingUserByEmail.password = hashedPassword;
existingUserByEmail.verifyCode = verifyCode;
existingUserByEmail.verifyCodeExpiry = new Date(Date.now() + 3600000);
await existingUserByEmail.save();
}
}

here changed the user info but not the username when the user is not verified so when we verify it the username is not found message occurred
so the user stuck the situation where not able to signup with same email when he is not verified
here we had two solutions

  1. forgot username route
  2. change the username according to second attempt

image

router not mounted

I am getting a run time error where it says the NextRouter is not mounted.

Did not update the username during signup where an user, with same email but not verified, enters different username

For the file at app\api\sign-up\route.ts,
There is an update line missing where an user ,whose entry is already there for having the same mail, enters a different username. It will cause problem since the verify page is based on username and that username would not be present though the entry is there.
Heres the github gist for the complete code for that page:
https://gist.github.com/career-tokens/14212eaa38809684838279f2ed64ab6d

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.