mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 178 forks source link

Logout is reported as failure erroneously #538

Open JuergenSimon opened 6 years ago

JuergenSimon commented 6 years ago

What type of issue are you creating?

What version of this module are you using?

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.

mbenedettini commented 6 years ago

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.