kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

Why does it stop sending logs completely after a 401 error? #19

Closed jnazander closed 5 years ago

jnazander commented 5 years ago

I'm using a custom authentication using cookies, and it seems that every time loglevel-plugin-remote receives a 401 error after sending a log (due to expired cookie, for example), it stops sending all future logs entirely, even after the cookie becomes refreshed. The only way to make it start sending again is to refresh the whole webapp.

I know that onUnauthorized gets called when this happens, but how to actually tell it that authorization is fine again? Returning true or false doesn't seem to make any difference.

jnazander commented 5 years ago

UPDATE: I found the solution now. The way to make it start sending logs again is to call setToken("") on the remote object.