mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-07-28 11:49:46 +02:00
logout google account when user sign out
This commit is contained in:
@ -43,7 +43,7 @@ class GoogleDriveHandler extends this.OS.API.VFS.BaseFileHandler
|
||||
_GUI.openDialog "YesNoDialog", (d) ->
|
||||
return _courrier.osinfo "User abort the authentification" unless d
|
||||
fn(gapi.auth2.getAuthInstance().isSignedIn.get())
|
||||
, "Authentification", { text: "Do you want to login to Google Drive ?" }
|
||||
, "Authentification", { text: "Would you like to login to Google Drive ?" }
|
||||
.catch (err) ->
|
||||
_API.loaded q, "FAIL"
|
||||
_courrier.oserror "VFS cannot init GAPI: #{err.error}", (_API.throwe "OS.VFS"), err
|
||||
@ -316,4 +316,21 @@ self.OS.API.onsearch "Google Drive", (t) ->
|
||||
file.complex = true
|
||||
file.detail = [{ text: file.path }]
|
||||
arr.push file
|
||||
return arr
|
||||
return arr
|
||||
|
||||
self.OS.onexit "cleanUpGoogleDrive", () ->
|
||||
G_CACHE = { "gdv:///": { id: "root", mime: 'dir' } }
|
||||
return unless _OS.setting.VFS.gdrive and _API.libready _OS.setting.VFS.gdrive.apilink
|
||||
auth2 = gapi.auth2.getAuthInstance()
|
||||
return unless auth2
|
||||
if auth2.isSignedIn.get()
|
||||
el = $ '<iframe/>', {
|
||||
src: 'https://www.google.com/accounts/Logout',
|
||||
frameborder: 0,
|
||||
onload: () ->
|
||||
#console.log("disconnect")
|
||||
auth2.disconnect()
|
||||
#$(this).remove()
|
||||
}
|
||||
#($ "body").append(el)
|
||||
|
Reference in New Issue
Block a user