Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Basic Auth always returns a 401 before it works #3406

@DanKaplanSES

Description

@DanKaplanSES

hi, I've implemented basic auth using angular and I've described how here: http://stackoverflow.com/questions/17959563/how-do-i-get-basic-auth-working-in-angularjs/17959564#17959564 But here's the weird thing: Even though this works correctly, the javascript console always reports a 401 FIRST and then it works. And I can see from the debugger that it's only going through my controller once. So that means some internal angular code is causing this to occur.

Here's what the console says (google chrome):

 Refused to set unsafe header "Access-Control-Request-Headers" angular.js:9271
 Failed to load resource: the server responded with a status of 401 (Unauthorized) http://localhost:8888/app/api/v1/pets

But the thing is, my $http call is NOT getting an error and it IS getting the correct data back.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions