thevahidal / soul

🕉 A SQLite REST and realtime server
https://thevahidal.github.io/soul/
MIT License
1.45k stars 49 forks source link

Fix soul crashing error due to sending response with two res objects #183

Closed AbegaM closed 2 months ago

AbegaM commented 2 months ago

Fixes #182

Modifications

  1. Modified the obtainAccessToken and the refreshAccessToken functions to avoid returning multiple response with the res object
  2. Modified the getRolesAndPermission function to no longer modify the response object

Note: in a Soul-CLI instance with auth tables that have been created/maintained using Soul the data inconsistency that this PR resolves would not be an issue. It can only be an issue when Soul-Auth is being added to an existing Soul database.

Testing Results

Previously, when a user without a role attempted to login, Soul was returning a Success message to the client. However, it has been modified to return the following error message instead:

Screen Shot 2024-04-26 at 11 56 34 AM