Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Alternative authcid #383

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
"tests"
],
"dependencies": {
"jquery": "~1.10.2",
"strophe": "1.1.3",
"strophejs-plugins": "benlangfeld/strophejs-plugins#30fb089457addc37e01d69c3536dee868a90a9ad",
"jquery": "~1.11.0",
"strophe": "strophe/strophejs#72914b87f56cf12e5e6a40c293cb9c6397bc7d16",
"strophejs-plugins": "strophe/strophejs-plugins#39d67d66e900bce8b990d9214bffe6593a96ddf7",
"mustache": "0.3.0",
"jquery-i18n": "1.1.1"
},
"resolutions": {
"strophe": "72914b87f56cf12e5e6a40c293cb9c6397bc7d16"
}
}
5 changes: 3 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ Candy.Core = (function(self, Strophe, $) {
* (String) password - Password of the user
* (String) nick - Nick of the user. Set one if you want to anonymously connect but preset a nick. If jidOrHost is a domain
* and this param is not set, Candy will prompt for a nick.
* (String) authcid - Authentication identity (username) if different from the JID.
*/
self.connect = function(jidOrHost, password, nick) {
self.connect = function(jidOrHost, password, nick, authcid) {
// Reset before every connection attempt to make sure reconnections work after authfail, alltabsclosed, ...
_connection.reset();
self.registerEventHandlers();
Expand Down Expand Up @@ -291,7 +292,7 @@ Candy.Core = (function(self, Strophe, $) {
}

// authentication
_connection.connect(_getEscapedJidFromJid(jidOrHost) + '/' + _options.resource, password, Candy.Core.Event.Strophe.Connect);
_connection.connect(_getEscapedJidFromJid(jidOrHost) + '/' + _options.resource, password, Candy.Core.Event.Strophe.Connect, undefined, undefined, undefined, authcid);
if (nick) {
_user = new self.ChatUser(jidOrHost, nick);
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ define({
// Packages that should be registered with the loader in each testing environment
packages: [
{ name: 'candy', location: '.' }
, { name: 'jquery', location: 'bower_components/jquery', main: 'jquery' }
, { name: 'jquery', location: 'bower_components/jquery/dist', main: 'jquery' }
, { name: 'sinon', location: 'node_modules/sinon/lib', main: 'sinon' }
, { name: 'sinon-chai', location: 'node_modules/sinon-chai/lib', main: 'sinon-chai' }
, { name: 'lolex', location: 'node_modules/lolex', main: 'lolex' }
Expand Down