()
| 328 | } |
| 329 | |
| 330 | async function getLoginCredentialsFromBrowser() { |
| 331 | const jid = localStorage.getItem('conversejs-session-jid'); |
| 332 | if (!jid) return null; |
| 333 | |
| 334 | try { |
| 335 | const creds = await navigator.credentials.get({ password: true }); |
| 336 | if (creds && creds.type == 'password' && isValidJID(creds.id)) { |
| 337 | // XXX: We don't actually compare `creds.id` with `jid` because |
| 338 | // the user might have been presented a list of credentials with |
| 339 | // which to log in, and we want to respect their wish. |
| 340 | await setUserJID(creds.id); |
| 341 | return { 'jid': creds.id, 'password': creds.password }; |
| 342 | } |
| 343 | } catch (e) { |
| 344 | log.error(e); |
| 345 | return null; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | async function getLoginCredentialsFromSCRAMKeys() { |
| 350 | const jid = localStorage.getItem('conversejs-session-jid'); |
no test coverage detected