Ride-The-Lightning / RTL

Ride The Lightning - A full function web browser app for LND, C-Lightning and Eclair
MIT License
732 stars 157 forks source link

Show permission denied error message on logout #1347

Closed ShahanaFarooqui closed 1 month ago

ShahanaFarooqui commented 5 months ago

Currently, clnrest throws the following error with status code 401 when a rune does not have the required permissions:

{
  "code": 1502,
  "message": "Not permitted: ..."
}

At this point, RTL assumes that the user is unauthorised and logs out with a generic message: Authentication Failed. Redirecting to Login.

In an ideal user experience, RTL should handle authorisation on every screen, allowing/blocking operations based on rune restrictions. Until this functionality is ready and prioritised, a temporary solution is to catch the message from the error and replace the generic message on the screen.

Cleaner Error Handling

Refactoring the error-handling (back-end and front-end both) while taking advantage of the improved consistency in the error object can produce cleaner and more maintainable code.

ShahanaFarooqui commented 1 month ago

Closing with #1391