feathers-authentication-popups
Advanced tools
Comparing version 0.0.5 to 0.0.9
# Change Log | ||
## [v0.0.8](https://github.com/feathersjs/feathers-authentication-popups/tree/v0.0.8) (2016-11-01) | ||
[Full Changelog](https://github.com/feathersjs/feathers-authentication-popups/compare/v0.0.7...v0.0.8) | ||
## [v0.0.7](https://github.com/feathersjs/feathers-authentication-popups/tree/v0.0.7) (2016-11-01) | ||
[Full Changelog](https://github.com/feathersjs/feathers-authentication-popups/compare/v0.0.6...v0.0.7) | ||
## [v0.0.6](https://github.com/feathersjs/feathers-authentication-popups/tree/v0.0.6) (2016-10-29) | ||
[Full Changelog](https://github.com/feathersjs/feathers-authentication-popups/compare/v0.0.5...v0.0.6) | ||
## [v0.0.5](https://github.com/feathersjs/feathers-authentication-popups/tree/v0.0.5) (2016-10-27) | ||
[Full Changelog](https://github.com/feathersjs/feathers-authentication-popups/compare/v0.0.4...v0.0.5) | ||
## [v0.0.4](https://github.com/feathersjs/feathers-authentication-popups/tree/v0.0.4) (2016-10-27) | ||
@@ -4,0 +16,0 @@ [Full Changelog](https://github.com/feathersjs/feathers-authentication-popups/compare/v0.0.3...v0.0.4) |
@@ -1,1 +0,1 @@ | ||
{"/Users/marshall/Sites/feathers-authentication-popups/src/index.js":{"path":"/Users/marshall/Sites/feathers-authentication-popups/src/index.js","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}},"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":30}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":52}},"4":{"start":{"line":10,"column":14},"end":{"line":10,"column":31}},"5":{"start":{"line":12,"column":15},"end":{"line":12,"column":46}},"6":{"start":{"line":14,"column":39},"end":{"line":14,"column":93}},"7":{"start":{"line":16,"column":16},"end":{"line":16,"column":77}},"8":{"start":{"line":23,"column":16},"end":{"line":23,"column":86}},"9":{"start":{"line":25,"column":14},"end":{"line":25,"column":35}},"10":{"start":{"line":26,"column":15},"end":{"line":26,"column":36}},"11":{"start":{"line":28,"column":30},"end":{"line":28,"column":73}},"12":{"start":{"line":29,"column":12},"end":{"line":29,"column":37}},"13":{"start":{"line":30,"column":13},"end":{"line":30,"column":39}},"14":{"start":{"line":32,"column":15},"end":{"line":32,"column":90}},"15":{"start":{"line":33,"column":2},"end":{"line":33,"column":48}},"16":{"start":{"line":41,"column":2},"end":{"line":44,"column":4}}},"fnMap":{"0":{"name":"_interopRequireDefault","decl":{"start":{"line":14,"column":9},"end":{"line":14,"column":31}},"loc":{"start":{"line":14,"column":37},"end":{"line":14,"column":95}}},"1":{"name":"openLoginPopup","decl":{"start":{"line":22,"column":9},"end":{"line":22,"column":23}},"loc":{"start":{"line":22,"column":29},"end":{"line":34,"column":1}}},"2":{"name":"getCenterCoordinates","decl":{"start":{"line":40,"column":9},"end":{"line":40,"column":29}},"loc":{"start":{"line":40,"column":53},"end":{"line":45,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":46},"end":{"line":14,"column":92}},"type":"cond-expr","locations":[{"start":{"line":14,"column":70},"end":{"line":14,"column":73}},{"start":{"line":14,"column":76},"end":{"line":14,"column":92}}]},"1":{"loc":{"start":{"line":14,"column":46},"end":{"line":14,"column":67}},"type":"binary-expr","locations":[{"start":{"line":14,"column":46},"end":{"line":14,"column":49}},{"start":{"line":14,"column":53},"end":{"line":14,"column":67}}]},"2":{"loc":{"start":{"line":23,"column":16},"end":{"line":23,"column":86}},"type":"cond-expr","locations":[{"start":{"line":23,"column":69},"end":{"line":23,"column":81}},{"start":{"line":23,"column":84},"end":{"line":23,"column":86}}]},"3":{"loc":{"start":{"line":23,"column":16},"end":{"line":23,"column":66}},"type":"binary-expr","locations":[{"start":{"line":23,"column":16},"end":{"line":23,"column":36}},{"start":{"line":23,"column":40},"end":{"line":23,"column":66}}]},"4":{"loc":{"start":{"line":25,"column":14},"end":{"line":25,"column":35}},"type":"binary-expr","locations":[{"start":{"line":25,"column":14},"end":{"line":25,"column":27}},{"start":{"line":25,"column":31},"end":{"line":25,"column":35}}]},"5":{"loc":{"start":{"line":26,"column":15},"end":{"line":26,"column":36}},"type":"binary-expr","locations":[{"start":{"line":26,"column":15},"end":{"line":26,"column":29}},{"start":{"line":26,"column":33},"end":{"line":26,"column":36}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1},"f":{"0":1,"1":1,"2":1},"b":{"0":[0,1],"1":[1,1],"2":[0,1],"3":[1,0],"4":[1,1],"5":[1,1]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"fee3c836c4f1146dcb74ef2fff919e334943e4ca"}} | ||
{"/Users/marshall/Sites/authentication-popups/src/feathers-authentication-popups.js":{"path":"/Users/marshall/Sites/authentication-popups/src/feathers-authentication-popups.js","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}},"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":30}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":33}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":52}},"4":{"start":{"line":10,"column":14},"end":{"line":10,"column":31}},"5":{"start":{"line":12,"column":15},"end":{"line":12,"column":46}},"6":{"start":{"line":14,"column":39},"end":{"line":14,"column":93}},"7":{"start":{"line":16,"column":0},"end":{"line":16,"column":42}},"8":{"start":{"line":18,"column":16},"end":{"line":18,"column":52}},"9":{"start":{"line":25,"column":16},"end":{"line":25,"column":86}},"10":{"start":{"line":27,"column":14},"end":{"line":27,"column":35}},"11":{"start":{"line":28,"column":15},"end":{"line":28,"column":36}},"12":{"start":{"line":30,"column":30},"end":{"line":30,"column":73}},"13":{"start":{"line":31,"column":12},"end":{"line":31,"column":37}},"14":{"start":{"line":32,"column":13},"end":{"line":32,"column":39}},"15":{"start":{"line":34,"column":15},"end":{"line":34,"column":90}},"16":{"start":{"line":35,"column":2},"end":{"line":35,"column":48}},"17":{"start":{"line":43,"column":2},"end":{"line":46,"column":4}}},"fnMap":{"0":{"name":"_interopRequireDefault","decl":{"start":{"line":14,"column":9},"end":{"line":14,"column":31}},"loc":{"start":{"line":14,"column":37},"end":{"line":14,"column":95}}},"1":{"name":"openLoginPopup","decl":{"start":{"line":24,"column":9},"end":{"line":24,"column":23}},"loc":{"start":{"line":24,"column":29},"end":{"line":36,"column":1}}},"2":{"name":"getCenterCoordinates","decl":{"start":{"line":42,"column":9},"end":{"line":42,"column":29}},"loc":{"start":{"line":42,"column":53},"end":{"line":47,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":46},"end":{"line":14,"column":92}},"type":"cond-expr","locations":[{"start":{"line":14,"column":70},"end":{"line":14,"column":73}},{"start":{"line":14,"column":76},"end":{"line":14,"column":92}}]},"1":{"loc":{"start":{"line":14,"column":46},"end":{"line":14,"column":67}},"type":"binary-expr","locations":[{"start":{"line":14,"column":46},"end":{"line":14,"column":49}},{"start":{"line":14,"column":53},"end":{"line":14,"column":67}}]},"2":{"loc":{"start":{"line":25,"column":16},"end":{"line":25,"column":86}},"type":"cond-expr","locations":[{"start":{"line":25,"column":69},"end":{"line":25,"column":81}},{"start":{"line":25,"column":84},"end":{"line":25,"column":86}}]},"3":{"loc":{"start":{"line":25,"column":16},"end":{"line":25,"column":66}},"type":"binary-expr","locations":[{"start":{"line":25,"column":16},"end":{"line":25,"column":36}},{"start":{"line":25,"column":40},"end":{"line":25,"column":66}}]},"4":{"loc":{"start":{"line":27,"column":14},"end":{"line":27,"column":35}},"type":"binary-expr","locations":[{"start":{"line":27,"column":14},"end":{"line":27,"column":27}},{"start":{"line":27,"column":31},"end":{"line":27,"column":35}}]},"5":{"loc":{"start":{"line":28,"column":15},"end":{"line":28,"column":36}},"type":"binary-expr","locations":[{"start":{"line":28,"column":15},"end":{"line":28,"column":29}},{"start":{"line":28,"column":33},"end":{"line":28,"column":36}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1},"f":{"0":1,"1":1,"2":1},"b":{"0":[0,1],"1":[1,1],"2":[0,1],"3":[1,0],"4":[1,1],"5":[1,1]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"1747b5d931404c7da871a475f40042db4f347039"}} |
{ | ||
"name": "feathers-authentication-popups", | ||
"description": "Server and client utils for implementing popup-based authentication flows", | ||
"version": "0.0.5", | ||
"version": "0.0.9", | ||
"homepage": "https://github.com/feathersjs/feathers-authentication-popups", | ||
"main": "lib/index", | ||
"main": "lib/feathers-authentication-popups", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "feathers", |
@@ -8,17 +8,10 @@ # feathers-authentication-popups | ||
[![Download Status](https://img.shields.io/npm/dm/feathers-authentication-popups.svg?style=flat-square)](https://www.npmjs.com/package/feathers-authentication-popups) | ||
[![Slack Status](http://slack.feathersjs.com/badge.svg)](http://slack.feathersjs.com) | ||
> Server and client utils for implementing popup-based authentication flows | ||
## Installation | ||
## Summary | ||
``` | ||
npm install feathers-authentication-popups --save | ||
``` | ||
## Documentation | ||
This package includes a few useful tools for implementing popup-based OAuth login flows. It contains utility functions for the browser and middleware for the server. | ||
Please refer to the [feathers-authentication-popups documentation](http://docs.feathersjs.com/) for more details. | ||
## Using the Client Utils | ||
@@ -45,3 +38,3 @@ There are two client utilities: one to assist with opening popups, and another to assist in cross-window communication. | ||
An EventEmitter automatically assigned as a global on the `window` object to allow popup windows to send information back to the main application window. Both windows must be on the same domain. | ||
An EventEmitter automatically assigned as a global at `window.authAgent` to allow popup windows to send information back to the main window. Both windows must be on the same domain for this to work. | ||
@@ -51,3 +44,4 @@ **Usage in the primary application window:** | ||
```js | ||
import {authAgent) from 'feathers-authentication-popups'; | ||
// Adds | ||
import 'feathers-authentication-popups'; | ||
@@ -58,4 +52,5 @@ function doSomethingWithToken (token) { | ||
authAgent.on('login', doSomethingWithToken); | ||
window.authAgent.on('login', doSomethingWithToken); | ||
``` | ||
The `doSomethingWithToken` function will run when the 'login' event is emitted on `window.authAgent`. | ||
@@ -98,6 +93,6 @@ **Usage in the popup window on the same domain:** | ||
### `handleAuthPopups(app)` | ||
### `successHandler(options|cookieName)` | ||
Creates Express middleware that handles successful auth by returning an HTML page that: | ||
* Pulls the token from the `app` JWT cookie location. The default is `feathers-jwt` | ||
* Pulls the token from the cookie location. | ||
* Sends the token to the parent window through the `authAgent`. | ||
@@ -107,10 +102,15 @@ * Closes the popup window. | ||
```js | ||
const handleAuthPopups = require('feathers-authentication-popups/middleware'); | ||
var successHandler = require('feathers-authentication-popups/middleware'); | ||
app.get('/auth/success', handleAuthPopups(app)) | ||
// Pass an object containing a `name` attribute. | ||
var options = app.get('cookie'); | ||
app.get('/auth/success', successHandler(options)); | ||
// Or pass a string for the cookie name. | ||
app.get('/auth/success', successHandler('feathers-jwt')); | ||
``` | ||
1. **app** `{FeathersServer}`: The Feathers server object. | ||
1. **options** `{Object}`: An object with a `name` attribute. | ||
1. **cookieName** `{String}`: The cookie name. | ||
## License | ||
@@ -117,0 +117,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
115660
37
900