login: add nsec qr-scanning
- Allow scanning of QR codes, and if detects a nsec, will provide it to the login prompt. - If nsec is found, provides option to keep nsec in keychain; default is to not store - User stays logged in until they logout, or app is force-quit if nsec is not stored. damusApp.swift: Obtains keypair from the notification generated to allow login. LoginView.swift: New views allowing for adding and logic handling the QR reader in QRScanNSECView.swift to enable QR scan for nsec. QRScanNSECView.swift: New view to scan for QR code. The sparkling magnifying glass is enabled if the view calling the QR view changes the privKeyFound bound variable. Tipjar: npub1el277q4kesp8vhs7rq6qkwnhpxfp345u7tnuxykwr67d9wg0wvyslam5n0 Closes: https://github.com/damus-io/damus/issues/1291 Changelog-Added: Add QR scan nsec logins. Signed-off-by: Jericho Hasselbush <jericho@sal-et-lucem.com> Reviewed-by: William Casarin <jb55@jb55.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
cf243e39c9
commit
439f9974c5
@@ -32,6 +32,9 @@ struct MainView: View {
|
||||
.onReceive(handle_notify(.login)) { notif in
|
||||
needs_setup = false
|
||||
keypair = get_saved_keypair()
|
||||
if keypair == nil, let tempkeypair = notif.to_full()?.to_keypair() {
|
||||
keypair = tempkeypair
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user