
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
strophejs-plugin-register
Advanced tools
A Strophe Plugin for In-Band Registration. ( XEP 0077 )
Just link the register plugin below the strophe library in your HTML head section:
<head>
<!-- ... -->
<script type="text/javascript" src="strophe.min.js"></script>
<script type="text/javascript" src="strophe.register.js"></script>
<!-- ... -->
</head>
To register a JID you need to listen for REGISTER und REGISTERED in your connection callback and use connection.register.connect() instead of connection.connect().
On REGISTER you need to inspect the connection.register.fields
object, fill in every field and call connection.register.submit().
(There may be more fields than username and password!)
On REGISTERED you can can then call connection.authenticate() if you want to login normally with the account you just created.
You should also listen for CONFLICT, REGIFAIL and NOTACCEPTABLE to catch failure-status of registrations.
Example for registering a new account and logging in with it:
var callback = function (status) {
if (status === Strophe.Status.REGISTER) {
// fill out the fields
connection.register.fields.username = "juliet";
connection.register.fields.password = "R0m30";
// calling submit will continue the registration process
connection.register.submit();
} else if (status === Strophe.Status.REGISTERED) {
console.log("registered!");
// calling login will authenticate the registered JID.
connection.authenticate();
} else if (status === Strophe.Status.CONFLICT) {
console.log("Contact already existed!");
} else if (status === Strophe.Status.NOTACCEPTABLE) {
console.log("Registration form not properly filled out.")
} else if (status === Strophe.Status.REGIFAIL) {
console.log("The Server does not support In-Band Registration")
} else if (status === Strophe.Status.CONNECTED) {
// do something after successful authentication
} else {
// Do other stuff
}
};
connection.register.connect("example.com", callback, wait, hold);
After that you're logged in with a fresh jid.
FAQs
A Strophe.js plugin for in-band registration (XEP-0077)
The npm package strophejs-plugin-register receives a total of 17 weekly downloads. As such, strophejs-plugin-register popularity was classified as not popular.
We found that strophejs-plugin-register demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.