File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
demos/credential-management-api-test Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -68,9 +68,17 @@ <h1>AN AMAZING DEMO OF THE ASTOUNDING CREDENTIAL MANAGER API!</h1>
68
68
69
69
var credential = createCredentialFromForm ( document . querySelector ( 'form' ) ) ;
70
70
if ( credential ) {
71
+ try {
71
72
navigator . credentials . notifySignedIn ( credential ) . then ( function ( ) {
72
73
addNote ( "Notification sent: " + credentialToString ( credential ) ) ;
73
74
} ) ;
75
+ } catch ( e ) {
76
+ if ( ! ( e instanceof TypeError ) )
77
+ throw e ;
78
+ navigator . credentials . store ( credential ) . then ( function ( ) {
79
+ addNote ( "Store credentials: " + credentialToString ( credential ) ) ;
80
+ } ) ;
81
+ }
74
82
}
75
83
}
76
84
} ) ;
@@ -89,7 +97,7 @@ <h1>AN AMAZING DEMO OF THE ASTOUNDING CREDENTIAL MANAGER API!</h1>
89
97
addIssue ( "Error: <code>" + e . message + "</code>" ) ;
90
98
} ) ;
91
99
}
92
- } ) ;
100
+ } ) ;
93
101
94
102
/*********************************************************************************
95
103
* HELPER FUNCTIONS THAT HAVE NOTHING TO DO WITH CREDENTIAL MANAGEMENT IN ITSELF *
You can’t perform that action at this time.
0 commit comments