Skip to content

Distinguish login failure due to incorrect password #45

Description

@superhawk610

Currently, incorrect email or password input to the login mutation both throw a UserNotFoundError, with no distinction made between the two. I would like to be able to tell the user whether their login failed due to an incorrect email or incorrect password.

Relevant Code:

mutations.ts

// line 177
if (!user) {
  throw new UserNotFoundError();
}

// line 196
const valid = await bcrypt.compare(password, user.password);
if (!valid) {
  throw new UserNotFoundError();
}

I understand that this may be by design, and if so, feel free to close this. I'll create a fork for my project and open a PR in case this functionality would be useful to others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions