Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit cca49a7

Browse files
ooth-jwt: Add tokenLocation - update documenation & example
1 parent a5694b5 commit cca49a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/index.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ const oothJwt = require("ooth-jwt").default;
297297

298298
oothJwt({
299299
ooth, // Required
300-
sharedSecret: SHARED_SECRET // Can be any long random string, needs to be shared with the API
300+
sharedSecret: SHARED_SECRET // Can be any long random string, needs to be shared with the API,
301+
tokenLocation: 'header' // Place to read token from. Can be 'body', 'header' or 'both'. Defaults to 'both'
301302
});
302303
```
303304

@@ -308,7 +309,8 @@ oothJwt({
308309
ooth, // Required
309310
privateKey: fs.readFileSync("path/to/private.key"),
310311
publicKey: fs.readFileSync("path/to/public.key"),
311-
algorithm: ALGORITHM_TU_USE // Defaults to 'RS256'. Used only if a publicKey / privateKey pair is provided
312+
algorithm: ALGORITHM_TO_USE, // Defaults to 'RS256'. Used only if a publicKey / privateKey pair is provided
313+
tokenLocation: 'header'
312314
});
313315
```
314316

examples/standalone/ooth/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function start() {
4949
})
5050
}
5151
oothUser({ ooth });
52-
oothJwt({ ooth, sharedSecret: process.env.SHARED_SECRET });
52+
oothJwt({ ooth, sharedSecret: process.env.SHARED_SECRET, tokenLocation: 'header' });
5353
oothWs({ ooth });
5454

5555
app.listen(process.env.PORT, function() {

0 commit comments

Comments
 (0)