loopback-sdk-builder icon indicating copy to clipboard operation
loopback-sdk-builder copied to clipboard

Logout is reported as failure erroneously

Open JuergenSimon opened this issue 7 years ago • 1 comments

What type of issue are you creating?

  • [X] Bug
  • [ ] Enhancement
  • [ ] Question

What version of this module are you using?

  • [X] 2.0.10 (Stable)
  • [ ] 2.1.0-rc.n (2.1 Release Candidate n)
  • [ ] Other

Write other if any:

Please add a description for your issue:

I'm using a set of generated classes for angular2 in a nativescript application. Logging in works fine, I get the token and all is well. Logging out works fine on the server (auth_token parameter is set) and completes with status 204. At this point the client-side framework classifies the response as an error and things go pear shaped. The response coming out the generated logout function now reads "Server Error", mostly because of this line in error.service.ts:

return Observable.throw(error.json().error || 'Server error');

However, the error must happen further up, where the 204 or the logout response in general is handled badly and qualified as an error.

JuergenSimon avatar Nov 06 '17 12:11 JuergenSimon

This is an issue in the underlying Angular of Nativescript, which has just been fixed in https://github.com/angular/angular/issues/19413#event-1364101975. Hopefully that fix will hit nativescript-angular soon.

mbenedettini avatar Dec 01 '17 14:12 mbenedettini