File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
demos/credential-management-api-test Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,21 @@ <h1>AN AMAZING DEMO OF THE ASTOUNDING CREDENTIAL MANAGER API!</h1>
98
98
function createCredentialFromForm ( form ) {
99
99
try {
100
100
if ( form . elements [ 'type' ] . value == "local" ) {
101
- return new LocalCredential (
101
+ try {
102
+ return new PasswordCredential (
102
103
form . elements [ 'username' ] . value ,
103
104
form . elements [ 'password' ] . value ,
104
105
form . elements [ 'friendly' ] . value ,
105
106
form . elements [ 'avatar' ] . value ) ;
107
+ } catch ( e ) {
108
+ if ( ! ( e instanceof ReferenceError ) )
109
+ throw e ;
110
+ return new LocalCredential (
111
+ form . elements [ 'username' ] . value ,
112
+ form . elements [ 'password' ] . value ,
113
+ form . elements [ 'friendly' ] . value ,
114
+ form . elements [ 'avatar' ] . value ) ;
115
+ }
106
116
} else {
107
117
return new FederatedCredential (
108
118
form . elements [ 'username' ] . value ,
You can’t perform that action at this time.
0 commit comments