Implement session sign out (password auth only)

This commit is contained in:
miruka
2020-06-29 10:30:44 -04:00
parent 8a3d9affaa
commit b47d4d981f
7 changed files with 85 additions and 32 deletions

View File

@@ -53,16 +53,32 @@ HColumnPage {
}
function deleteDevices(...indice) {
const deviceIds = []
if (indice.length === 1 && indice[0] === 0) {
utils.makePopup("Popups/SignOutPopup.qml", { userId: page.userId })
return
}
for (const i of indice.sort())
const deviceIds = []
let deleteOwnDevice = false
for (const i of indice.sort()) {
i === 0 ?
deleteOwnDevice = true :
deviceIds.push(deviceList.model.get(i).id)
}
utils.makePopup(
"Popups/AuthentificationPopup.qml",
"Popups/DeleteDevicesPopup.qml",
{
userId: page.userId,
deviceIds,
deletedCallback: () => {
deleteOwnDevice ?
utils.makePopup(
"Popups/SignOutPopup.qml", { userId: page.userId },
) :
page.loadDevices()
},
},
)
}