silexlabs / unifile

Unified access to cloud storage services through a simple web API.
https://silexlabs.github.io/unifile/
MIT License
144 stars 32 forks source link

Issue with logout #14

Closed zabojad closed 7 years ago

zabojad commented 10 years ago

I think I've spotted some issue with logging out from services:

Here is a network call snapshot from my web browser:

logout
/api/1.0/dropbox
Status Code:200 OK
{"success":true,"message":"Now logged out."}

logout
/api/1.0/www
Status Code:200 OK
{"success":true,"message":"Now logged out."}

ls/
/api/1.0/www/exec
Status Code:401 Unauthorized
{
  "success": false,
  "message": "User not connected yet. You need to call the 'login' service first.",
  "code": 401
}

list
/api/1.0/services
Status Code:200 OK
[{"name":"dropbox","display_name":"Dropbox","image_small":"unifile-assets/services/dropbox.png","description":"Edit html files from your Dropbox.","visible":true,"isLoggedIn":true,"isConnected":true,"isOAuth":true,"user":{"display_name":"Thomas Fétiveau","quota_info":{"available":2952790016,"used":2402940491}}},{"name":"www","display_name":"Web server","image_small":"unifile-assets/services/www.png","description":"Edit files on the server where Silex is installed.","visible":true,"isLoggedIn":false,"isConnected":false,"isOAuth":false},{"name":"ftp","display_name":"FTP","image_small":"unifile-assets/services/ftp.png","description":"Edit files on a web server.","visible":true,"isLoggedIn":false,"isConnected":false,"isOAuth":false,"user":{"host":"blablablabla","port":"21","username":"blabla","password":"blablabla"}}]

ls/
/api/1.0/dropbox/exec
Status Code:200 OK
[{"name":"anim3d-zabo-nico","bytes":0,"modified":"Wed, 21 May 2014 19:22:33 +0000","is_dir":true},{"name":"apps","bytes":0,"modified":"Tue, 10 Jun 2014 09:04:47 +0000","is_dir":true},{"name":"EuropaApps","bytes":0,"modified":"Mon, 16 Dec 2013 08:19:23 +0000","is_dir":true},{"name":"Launcher","bytes":0,"modified":"Mon, 16 Dec 2013 08:19:23 +0000","is_dir":true},{"name":"Player_v60x","bytes":0,"modified":"Mon, 16 Dec 2013 08:19:23 +0000","is_dir":true},{"name":"pol","bytes":0,"modified":"Fri, 27 Sep 2013 08:25:13 +0000","is_dir":true},{"name":"test1.htm","bytes":22,"modified":"Thu, 17 Apr 2014 18:48:14 +0000","is_dir":false},{"name":"test2.htm","bytes":22,"modified":"Thu, 17 Apr 2014 18:48:30 +0000","is_dir":false},{"name":"test3.htm","bytes":22,"modified":"Sun, 18 May 2014 15:06:35 +0000","is_dir":false},{"name":"test4.htm","bytes":22,"modified":"Sun, 18 May 2014 15:07:05 +0000","is_dir":false}]

The problem here is that we expect the call to services/list to return the services with LoggedIn set to false. And it appears to be true for Dropbox... The last ls call should return 401 forbidden. It seems logging out from DB did not succeed whereas it returned true...

Note that the calls after the logout calls (ls, list, ...) happened when logout calls already returned to my browser.

zabojad commented 10 years ago

One other thing is that it seems to keep the FTP url, login and pass in cookie or session ? I'm not sure it should do that...

zabojad commented 10 years ago

@lexoyo Any news about this ?

I'm still having issue when logging out simultaneously from several services:

logout
/api/1.0/dropbox

=> {"success":true,"message":"Now logged out."}

logout
/api/1.0/www

=> {"success":true,"message":"Now logged out."}

list
/api/1.0/services

=> [{"name":"dropbox","display_name":"Dropbox","image_small":"unifile-assets/services/dropbox.png","description":"Edit html files from your Dropbox.","visible":true,"isLoggedIn":true,"isConnected":true,"isOAuth":true,"user":{"display_name":"Thomas Fétiveau","quota_info":{"available":113279762432,"used":9157457865}}},{"name":"www","display_name":"Web server","image_small":"unifile-assets/services/www.png","description":"Edit files on the server where Silex is installed.","visible":true,"isLoggedIn":false,"isConnected":false,"isOAuth":false},{"name":"ftp","display_name":"FTP","image_small":"unifile-assets/services/ftp.png","description":"Edit files on a web server.","visible":true,"isLoggedIn":false,"isConnected":false,"isOAuth":false}]

The above network snapshop shows that requesting unifile to log out from 2 services result in being looged out from only one of them... This problem is affecting CE's logoutAll functionnality.

lexoyo commented 10 years ago

oups, I was not aware of that i'll fix it soon