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
7eecd6b1
Commit
7eecd6b1
authored
May 11, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move method closer to other relevant ones
parent
0c61a5d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
src/converse-core.js
src/converse-core.js
+33
-33
No files found.
src/converse-core.js
View file @
7eecd6b1
...
...
@@ -1938,6 +1938,39 @@
}
};
this
.
attemptNonPreboundSession
=
function
(
credentials
,
reconnecting
)
{
/* Handle session resumption or initialization when prebind is not being used.
*
* Two potential options exist and are handled in this method:
* 1. keepalive
* 2. auto_login
*/
if
(
!
reconnecting
&&
this
.
keepalive
&&
this
.
restoreBOSHSession
())
{
return
;
}
if
(
this
.
auto_login
)
{
if
(
credentials
)
{
// When credentials are passed in, they override prebinding
// or credentials fetching via HTTP
this
.
autoLogin
(
credentials
);
}
else
if
(
this
.
credentials_url
)
{
this
.
fetchLoginCredentials
().
done
(
this
.
autoLogin
.
bind
(
this
));
}
else
if
(
!
this
.
jid
)
{
throw
new
Error
(
"
attemptNonPreboundSession: If you use auto_login,
"
+
"
you also need to give either a jid value (and if
"
+
"
applicable a password) or you need to pass in a URL
"
+
"
from where the username and password can be fetched
"
+
"
(via credentials_url).
"
);
}
else
{
this
.
autoLogin
();
// Probably ANONYMOUS login
}
}
else
if
(
reconnecting
)
{
this
.
autoLogin
();
}
};
this
.
autoLogin
=
function
(
credentials
)
{
if
(
credentials
)
{
// If passed in, then they come from credentials_url, so we
...
...
@@ -1976,39 +2009,6 @@
}
};
this
.
attemptNonPreboundSession
=
function
(
credentials
,
reconnecting
)
{
/* Handle session resumption or initialization when prebind is not being used.
*
* Two potential options exist and are handled in this method:
* 1. keepalive
* 2. auto_login
*/
if
(
!
reconnecting
&&
this
.
keepalive
&&
this
.
restoreBOSHSession
())
{
return
;
}
if
(
this
.
auto_login
)
{
if
(
credentials
)
{
// When credentials are passed in, they override prebinding
// or credentials fetching via HTTP
this
.
autoLogin
(
credentials
);
}
else
if
(
this
.
credentials_url
)
{
this
.
fetchLoginCredentials
().
done
(
this
.
autoLogin
.
bind
(
this
));
}
else
if
(
!
this
.
jid
)
{
throw
new
Error
(
"
attemptNonPreboundSession: If you use auto_login,
"
+
"
you also need to give either a jid value (and if
"
+
"
applicable a password) or you need to pass in a URL
"
+
"
from where the username and password can be fetched
"
+
"
(via credentials_url).
"
);
}
else
{
this
.
autoLogin
();
// Probably ANONYMOUS login
}
}
else
if
(
reconnecting
)
{
this
.
autoLogin
();
}
};
this
.
logIn
=
function
(
credentials
,
reconnecting
)
{
// We now try to resume or automatically set up a new session.
// Otherwise the user will be shown a login form.
...
...
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