dnt-connect
Advanced tools
Comparing version 3.0.1 to 3.0.2
10
index.js
@@ -258,2 +258,12 @@ 'use strict'; | ||
/* | ||
* | ||
* Express.js compatible middleare | ||
* | ||
* @param <string-utf8> type - "signon" or "bounce" | ||
* | ||
* @return <function> Express.js compatible middleare function | ||
* | ||
*/ | ||
C.prototype.middleware = function middleare(type) { | ||
@@ -260,0 +270,0 @@ const that = this; |
{ | ||
"name": "dnt-connect", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Node.JS library for DNT's single sign on service DNT Connect", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,2 +39,6 @@ # DNT Connect | ||
**Imortant!** The key should be a `base64` representation of your secret key in | ||
order for the `dnt-connect` package to decrypt the response from DNT Connect | ||
properly. | ||
### Bounce | ||
@@ -60,2 +64,19 @@ | ||
### Middleare | ||
For your convenience we have provided a fully compatible Express.js middeware | ||
tha can `bounce` or do a full `signon` of your users. A full example can be | ||
found in | ||
[here](https://github.com/Turistforeningen/node-dnt-connect/blob/master/examples/server.js). | ||
```javascript | ||
app.get('/connect', connect.middleware('signon'), function getAuth(req, res) { | ||
if (req.dntConnect.err) { | ||
res.status(500).json({error: err.message}); | ||
} else { | ||
res.status(200).json({data: req.dntConnect.data}); | ||
} | ||
}); | ||
``` | ||
### Decrypt Response | ||
@@ -62,0 +83,0 @@ |
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
22209
496
107