Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passport-bitbucket-token

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-bitbucket-token - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

12

lib/index.js

@@ -89,3 +89,3 @@ 'use strict';

var emailUrlPath = this._apiVersion === '2.0' ? 'https://api.bitbucket.org/2.0/user/emails' : 'https://api.bitbucket.org/1.0/users/' + accountName + '/emails';
var emailUrlPath = this.isApiV1() ? 'https://api.bitbucket.org/1.0/users/' + accountName + '/emails' : 'https://api.bitbucket.org/2.0/user/emails';
var emailUrl = _url2.default.parse(emailUrlPath);

@@ -98,5 +98,4 @@

var json = JSON.parse(body);
profile.emails = _this3.isApiV1() ? _v1Profile2.default.emails(json) : _v2Profile2.default.emails(json);
profile.emails = _this3._apiVersion === '2.0' ? _v2Profile2.default.emails(json) : _v1Profile2.default.emails(json);
console.log(profile);
done(null, profile);

@@ -109,2 +108,7 @@ } catch (e) {

}, {
key: 'isApiV1',
value: function isApiV1() {
return this._apiVersion === '1.0';
}
}, {
key: 'userProfile',

@@ -122,3 +126,3 @@ value: function userProfile(accessToken, done) {

var profile = _this4._apiVersion === '1.0' ? _v1Profile2.default.profile(json, body) : _v2Profile2.default.profile(json, body);
var profile = _this4.isApiV1() ? _v1Profile2.default.profile(json, body) : _v2Profile2.default.profile(json, body);

@@ -125,0 +129,0 @@ if (_this4._profileWithEmail) {

{
"name": "passport-bitbucket-token",
"version": "0.2.0",
"version": "1.0.0",
"description": "Passport strategy for authenticating with Bitbucket access tokens using the OAuth 2.0 API.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -83,2 +83,48 @@ # passport-bitbucket-token

### Profile examples
In this section we will show examples of parsed profile that are returned to `verify` callback.
#### Bitbucket API v1.0
```js
{
provider: 'bitbucket',
id: 'john_doe',
username: 'john_doe',
name: { first_name: 'John', last_name: 'Doe' },
emails: [{value: 'test@example.com', primary: true, verified: true}]
avatar: 'https://bitbucket.org/account/john_doe/avatar/32/?ts=1492462087',
_raw: 'raw json object from Bitbucket server',
_json:
{
'parsed json object from server'
}
}
```
#### Bitbucket API v2.0
```js
{
provider: 'bitbucket',
id: 'john_doe',
username: 'john_doe',
display_name: 'John Doe',
emails: [{value: 'test@example.com', primary: true, verified: true}]
avatar: 'https://bitbucket.org/account/john_doe/avatar/32/?ts=1492462087',
_raw: 'raw json object from Bitbucket server',
_json:
{
'parsed json object from server'
}
}
```
# Examples
Example of server application can be found [here](https://github.com/GenFirst/passport-bitbucket-token/tree/master/example/backend).
Full example of React.js + Node.js/Express.js can be found [here](https://github.com/GenFirst/react-node-bitbucket-login).
# License

@@ -85,0 +131,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc