Search code examples
javascriptamazon-web-servicesjestjsamazon-cognitoaws-amplify

Amplify timeout when doing Auth calls


I set up auth through API, and I'd like to signin with created and confirmed cognito user in this way:

describe("Tests authentication", () => {
    it("should signup/signin", async () => {

    const loggedin = await Auth.signIn('user@email.com', 'password')
}

However I am getting timeout error. At the same time signup works well, adn if I am input wrong username/password it prompts me error message, (so cognito is reachable). The timeout happens for admin queries.

Any help is much appreciated.

This occurs in jest test only.


Solution

  • It because Api was slow, and I increase by setting 3rd argument of "it" preferred timeout. Changing Axios timeout will not fix this.