Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use axios supplied basic auth functionality #18

Open
nwinch opened this issue May 31, 2016 · 0 comments
Open

Use axios supplied basic auth functionality #18

nwinch opened this issue May 31, 2016 · 0 comments

Comments

@nwinch
Copy link
Contributor

nwinch commented May 31, 2016

Currently basic auth is implemented with custom headers as an interceptor for all requests, though axios can support basic auth as an options - from the docs:

// `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
// This will set an `Authorization` header, overwriting any existing
// `Authorization` custom headers you have set using `headers`.
auth: {
  username: 'janedoe',
  password: 's00pers3cret'
}

I suggest we change the auth-driver opts to match axios opts. So this would change:

{
  password: 'secret'
}

to...

{
  auth: {
    username: 'user',
    password: 'secret'
  }
}

By doing this it would remove unnecessary code as the functionality is supported natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant