Provide basic support about one time password (totp only)

This commit is contained in:
Yishi Lin 2017-03-03 14:45:16 +08:00
parent 71cb9a02c0
commit 3dac155d6c
2 changed files with 95 additions and 0 deletions

View file

@ -199,6 +199,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
self.tableData[tableDataIndex].item.append(TableCell(title: "username", content: username))
}
self.tableData[tableDataIndex].item.append(TableCell(title: "password", content: password.password))
// Show additional information
if password.additions.count > 0 {
self.tableData.append(TableSection(title: "additions", item: []))
tableDataIndex += 1
@ -212,6 +213,14 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
}
}
// Show one time password
if password.otpType == "totp", password.otpToken != nil {
self.tableData.append(TableSection(title: "One time password (TOTP)", item: []))
tableDataIndex += 1
if let crtPassword = password.otpToken?.currentPassword {
self.tableData[tableDataIndex].item.append(TableCell(title: "current", content: crtPassword))
}
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {