You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Authenticator/UI/TokenSession/TokenRequestYubiOTPViewController.swift
+16-4
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,12 @@ class TokenRequestYubiOTPViewController: UIViewController {
18
18
19
19
@IBActionfunc disableOTP(){
20
20
viewModel?.disableOTP{ error in
21
-
guard error ==nilelse{return}
22
-
UIView.animate(withDuration:0.5){
23
-
DispatchQueue.main.async{
21
+
guard error ==nilelse{
22
+
self.presentError(error)
23
+
return
24
+
}
25
+
DispatchQueue.main.async{
26
+
UIView.animate(withDuration:0.5){
24
27
self.optionsView.alpha =0
25
28
self.completedView.alpha =1
26
29
self.viewModel?.waitForKeyRemoval{
@@ -33,10 +36,19 @@ class TokenRequestYubiOTPViewController: UIViewController {
33
36
34
37
@IBActionfunc ignoreThisKey(){
35
38
viewModel?.ignoreThisKey{ error in
36
-
guard error ==nilelse{return}
39
+
guard error ==nilelse{
40
+
self.presentError(error)
41
+
return
42
+
}
37
43
DispatchQueue.main.async{
38
44
self.dismiss(animated:true)
39
45
}
40
46
}
41
47
}
48
+
49
+
privatefunc presentError(_ error:Error?){
50
+
guardlet error else{return}
51
+
letalert=UIAlertController(title:"Error reading YubiKey", message:"\(error.localizedDescription)\n\nRemove and reinsert your YubiKey."){self.dismiss(animated:true)}
0 commit comments