mhoc / axios-digest-auth

Axios-like HTTP Digest Auth
https://axios-digest-auth.mhoc.co
The Unlicense
12 stars 20 forks source link

Keep showing username and password pop-up #8

Open pedroR opened 2 years ago

pedroR commented 2 years ago

Hi, I am trying to use this module into my web application, but it keeps asking me username and password. Here's my demo code:

const handleRequest =  (digestAuthProps: AxiosDigestAuth) => {
        digestAuthProps.request({
            headers: {Accept: "application/json"},
            method: "GET",
            url: baseUrl + 'account',
            withCredentials: true
        }).then((response: any) => {
            console.log(response);
        }).catch((err: any) => {
            console.log( err.response);
        });
    }

When in debug I inspect digestAuthProps I can see the correct login and password image

Is this plugin works for client side web application or ONLY for NodeJs? It it works for web application what am I doing wrong?

Thanks