Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
2a3ca932
Commit
2a3ca932
authored
Jan 12, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: don't use Chrome-only check for web auth support
parent
22ff93c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/headless/converse-core.js
src/headless/converse-core.js
+10
-5
No files found.
src/headless/converse-core.js
View file @
2a3ca932
...
...
@@ -491,7 +491,7 @@ async function attemptNonPreboundSession (credentials, automatic) {
connect
(
await
getLoginCredentials
());
}
else
if
(
_converse
.
jid
&&
(
_converse
.
password
||
_converse
.
connection
.
pass
))
{
connect
();
}
else
if
(
!
_converse
.
isTestEnv
()
&&
window
.
PasswordCredential
)
{
}
else
if
(
!
_converse
.
isTestEnv
()
&&
'
credentials
'
in
navigator
)
{
connect
(
await
getLoginCredentialsFromBrowser
());
}
else
{
log
.
warn
(
"
attemptNonPreboundSession: Could not find any credentials to log in with
"
);
...
...
@@ -774,6 +774,7 @@ async function onConnected (reconnecting) {
delete
_converse
.
connection
.
reconnecting
;
_converse
.
connection
.
flush
();
// Solves problem of returned PubSub BOSH response not received by browser
await
_converse
.
setUserJID
(
_converse
.
connection
.
jid
);
/**
* Synchronous event triggered after we've sent an IQ to bind the
* user's JID resource for this session.
...
...
@@ -912,10 +913,14 @@ async function getLoginCredentials () {
}
async
function
getLoginCredentialsFromBrowser
()
{
const
creds
=
await
navigator
.
credentials
.
get
({
'
password
'
:
true
});
if
(
creds
&&
creds
.
type
==
'
password
'
&&
u
.
isValidJID
(
creds
.
id
))
{
await
_converse
.
setUserJID
(
creds
.
id
);
return
{
'
jid
'
:
creds
.
id
,
'
password
'
:
creds
.
password
};
try
{
const
creds
=
await
navigator
.
credentials
.
get
({
'
password
'
:
true
});
if
(
creds
&&
creds
.
type
==
'
password
'
&&
u
.
isValidJID
(
creds
.
id
))
{
await
_converse
.
setUserJID
(
creds
.
id
);
return
{
'
jid
'
:
creds
.
id
,
'
password
'
:
creds
.
password
};
}
}
catch
(
e
)
{
log
.
error
(
e
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment