Auth/token endpoint get status 500

I want to create my design for my login and still use Auth0 authentication.
Im trying to get the token with the client’s email and password, and i get status 500.
i work with Nodejs and this is my code:

function options(email, password) {
return {
method: ‘POST’,
url: https://${auth0Config.auth0Domain}/oauth/token,
headers: { ‘content-type’: ‘application/x-www-form-urlencoded’ },
data: new URLSearchParams({
grant_type: auth0Config.grant_type,
client_id: auth0Config.client_id,
client_secret: auth0Config.client_secret,
audience: auth0Config.audience,
username: email,
password: password,
scope: ‘read:sample’
})
}
};

async function findTokenWithPassword(email, password) {
try {
const option = options(email, password);
const response = await axios.request(option);

    if (!response.status === 200) {
        throw new Error('Invalid password/username');
    }

    return response;
} catch (error) {
    throw error;
}

}

I appreciate getting any help.

Hi @eden.amram

Welcome to the Auth0 Community!

We are investigating this issue. I will update you as soon as I will have more details.

Thanks
Dawid

Thank you.

I just got the answer after many hours!

I added this and it fixed the problem:

1 Like

Thank you for the update for the rest of the community!

I’m glad you found the solution to your issue.

Thanks
Dawid

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.