cornflourblue / angular-registration-login-example

AngularJS User Registration and Login Example
http://jasonwatmore.com/post/2015/03/10/AngularJS-User-Registration-and-Login-Example.aspx
MIT License
468 stars 497 forks source link

removed blank's from 'Basic' authorisation headers … … #2

Closed gp4pgit closed 8 years ago

gp4pgit commented 8 years ago

This fixes the following error: [Error] Error: SyntaxError: DOM Exception 12 setRequestHeader@[native code]...

gp4pgit commented 8 years ago

Now it should fit... finally... :-)

cornflourblue commented 8 years ago

Have you tested this with a real back end api? I think it will fail to authenticate if the authorization header doesn't have a space between the 'Basic' and the Base64 encoded auth data.

You might just need to remove the space from the ClearCredentials function on line 61 of authentication.service.js.

cornflourblue commented 8 years ago

I've just updated the ClearCredentials function to remove the trailing space from the auth header when logging out.

Thanks for the help!