mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-28 10:18:21 +01:00
logout google account when user sign out
This commit is contained in:
parent
aeecaa4e81
commit
b35096bcca
@ -118,3 +118,12 @@ self.OS or=
|
|||||||
else
|
else
|
||||||
# startX :)
|
# startX :)
|
||||||
_GUI.startAntOS d.result
|
_GUI.startAntOS d.result
|
||||||
|
|
||||||
|
cleanupHandlers: {}
|
||||||
|
exit: ->
|
||||||
|
#do clean up first
|
||||||
|
f() for n, f of _OS.cleanupHandlers
|
||||||
|
_API.handler.setting () ->
|
||||||
|
_API.handler.logout()
|
||||||
|
onexit: (n, f) ->
|
||||||
|
self.OS.cleanupHandlers[n] = f unless self.OS.cleanupHandlers[n]
|
@ -334,7 +334,7 @@ self.OS.GUI =
|
|||||||
dataid: "sys-logout",
|
dataid: "sys-logout",
|
||||||
iconclass: "fa fa-user-times"
|
iconclass: "fa fa-user-times"
|
||||||
menu.onmenuselect = (d) ->
|
menu.onmenuselect = (d) ->
|
||||||
return _API.handler.logout() if d.item.data.dataid is "sys-logout"
|
return _OS.exit() if d.item.data.dataid is "sys-logout"
|
||||||
return _GUI.toggleFullscreen() if d.item.data.dataid is "os-fullsize"
|
return _GUI.toggleFullscreen() if d.item.data.dataid is "os-fullsize"
|
||||||
_GUI.launch d.item.data.app unless d.item.data.dataid
|
_GUI.launch d.item.data.app unless d.item.data.dataid
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ self.OS.API.handler =
|
|||||||
_API.post p, d, c, () ->
|
_API.post p, d, c, () ->
|
||||||
alert "Resource not found: #{p}"
|
alert "Resource not found: #{p}"
|
||||||
logout: () ->
|
logout: () ->
|
||||||
_API.handler.setting () ->
|
|
||||||
p = "#{_REST}/system/logout"
|
p = "#{_REST}/system/logout"
|
||||||
_API.post p, {}, (d) ->
|
_API.post p, {}, (d) ->
|
||||||
_OS.boot()
|
_OS.boot()
|
||||||
|
@ -43,7 +43,7 @@ class GoogleDriveHandler extends this.OS.API.VFS.BaseFileHandler
|
|||||||
_GUI.openDialog "YesNoDialog", (d) ->
|
_GUI.openDialog "YesNoDialog", (d) ->
|
||||||
return _courrier.osinfo "User abort the authentification" unless d
|
return _courrier.osinfo "User abort the authentification" unless d
|
||||||
fn(gapi.auth2.getAuthInstance().isSignedIn.get())
|
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) ->
|
.catch (err) ->
|
||||||
_API.loaded q, "FAIL"
|
_API.loaded q, "FAIL"
|
||||||
_courrier.oserror "VFS cannot init GAPI: #{err.error}", (_API.throwe "OS.VFS"), err
|
_courrier.oserror "VFS cannot init GAPI: #{err.error}", (_API.throwe "OS.VFS"), err
|
||||||
@ -317,3 +317,20 @@ self.OS.API.onsearch "Google Drive", (t) ->
|
|||||||
file.detail = [{ text: file.path }]
|
file.detail = [{ text: file.path }]
|
||||||
arr.push file
|
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)
|
||||||
|
|
@ -16,7 +16,7 @@ class UserService extends this.OS.GUI.BaseService
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
@onmenuselect = (d) ->
|
@onmenuselect = (d) ->
|
||||||
return me._api.handler.logout() if d.item.data.dataid is "sys-logout"
|
return window.OS.exit() if d.item.data.dataid is "sys-logout"
|
||||||
me.notify "This feature is not implemented yet"
|
me.notify "This feature is not implemented yet"
|
||||||
awake: (e) ->
|
awake: (e) ->
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user