ssb-invite
Advanced tools
Comparing version 2.1.7 to 3.0.0
@@ -151,7 +151,5 @@ 'use strict' | ||
// check if we're already following them | ||
server.friends.get((err, follows) => { | ||
server.friends.isFollowing({ source: server.id, dest: req.feed }, (err, isFollowing) => { | ||
if (err) return cb(err) | ||
// server.friends.all('follow', function(err, follows) { | ||
// if(hops[req.feed] == 1) | ||
if (follows && follows[server.id] && follows[server.id][req.feed]) { return cb(new Error('already following')) } | ||
if (isFollowing) { return cb(new Error('already following')) } | ||
@@ -158,0 +156,0 @@ // although we already know the current feed |
{ | ||
"name": "ssb-invite", | ||
"description": "", | ||
"version": "2.1.7", | ||
"version": "3.0.0", | ||
"homepage": "https://github.com/ssbc/ssb-invite", | ||
@@ -10,7 +10,2 @@ "repository": { | ||
}, | ||
"scripts": { | ||
"test": "npm run test:js && npm run lint", | ||
"test:js": "tape test/*.test.js", | ||
"lint": "standard --fix" | ||
}, | ||
"dependencies": { | ||
@@ -29,3 +24,3 @@ "cont": "^1.0.3", | ||
"scuttle-testbot": "^1.2.3", | ||
"ssb-friends": "^4.1.4", | ||
"ssb-friends": "^5.1.0", | ||
"ssb-replicate": "^1.3.2", | ||
@@ -37,3 +32,9 @@ "ssb-ws": "^6.2.3", | ||
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)", | ||
"license": "MIT" | ||
} | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "npm run test:js && npm run lint", | ||
"test:js": "tape test/*.test.js", | ||
"lint": "standard --fix" | ||
}, | ||
"readme": "# ssb-invite\n\nInvite-token system, mainly used for pubs. Creates invite codes as one of ways of onboarding.\n\nGenerally this ends being used for pubs:\n\n- Users choose a pub from a [list of pubs](https://github.com/ssbc/ssb-server/wiki/Pub-Servers).\n- The chosen pub gives out an invite code to the user via the pub's website.\n- The user installs a Scuttlebutt client and copy and paste the invite code into the client's \"accept invite\" prompt.\n- The pub validates the invite code and follows back the new user, making them visible to other Scuttlebutt users.\n\nSoon, hopefully supercededed by [ssb-peer-invites](https://github.com/ssbc/ssb-peer-invites) but supported for backwards compatibity.\n\n## api\n\n### create ({uses, note, external, modern}, cb(err, invite_code))\n\nCreate a new invite code.\n\n- `uses` (number): How many times the invite can be used before it expires.\n- `note` (string): A note to associate with the invite code. The ssb-server instance will\n include this note in the follow message that it creates when `use` is\n called.\n- `external` (string): An external hostname to use\n- `modern` (boolean): if true the invite code will be a valid multiserver address.\n - if modern is enabled, uses will be set to 1.\n - :warning: \"modern\" invites with ipv6 addresses currently have some problems\n\nThis produces an invite-code which encodes the ssb-server instance's public address,\nand a keypair seed. The keypair seed is used to generate a keypair, which is then used to authenticate a connection with the ssb-server instance.\nThe ssb-server instance will then grant access to the `use` call.\n\n### accept(invite_code, cb)\n\nUse an invite code.\n\n - invite_code (string): an invite code returned by `create`\n\nThis connects to the server address encoded in the invite-code, then calls `use()` on the server.\nIt will cause the server to follow the local user.\n\n\n### use ({feed:feedId}), cb)\n\nThis method is used internally, it is called on the remote pub by your local instance\nwhen you call `accept`. To call `use` you must authenticate\nas a guest, by using the seed in an invite code, that was created by this pub.\n\n`use({feed: feed_id}, cb)`\n\nThis commands the receiving server to follow the given feed.\n\nAn invite-code encodes the ssb-server instance's address, and a keypair seed.\nThe keypair seed must be used to generate a keypair, then authenticate a connection with the ssb-server instance, in order to use this function.\n\n - `feed` (feedid): The feed the server should follow.\n\n## License\n\nMIT\n" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28896
587
1