AuthenticationService.login error

I have a custom login endpoint which returns

{
   extensions: 'Invalid user credentials.',
   code: 'INTERNAL_SERVER_ERROR',
   status: 500
}

yet my login credentials are correct.

My code is

// return token
    const authenticationService = new AuthenticationService({
      accountability: null,
      schema: await getSchema(),
    });

    const loginResponse = await authenticationService
      .login(
        "default",
        {
          email: value.email,
          password: value.password,
        },
        { session: false }
      )
      .catch((error: any) => {
        throw new InternalServerError(error.message);
      });

Hi Gaideh,

Can you share the logs of Directus itself?
Most of the time internal server errors tell you more about the issue(s).

I have figured out the reason I am getting this is because, the user status is ‘unverified’. I need to verify the user before I can login

The user status needs to be active before you can login.