Skip to content

Commit

Permalink
fix(docs/new-features): syntax highlighting (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
justingreenberg authored and daffl committed Aug 29, 2018
1 parent d3bdee6 commit 4ab7c95
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/authentication/docs/new-1.0-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

You can override this property for each passport authentication strategy like so:

```js
// when calling from hooks
auth.hooks.authenticate('local', { assignProperty: 'custom' })
// when calling from middleware
auth.express.authenticate('local', { assignProperty: 'custom' })
// For sockets and all other methods you can have it in your main
// config or pass explicitly when initializing auth.
app.configure(authentication({
local: {
assignProperty: 'custom'
}
}))
```
```js
// when calling from hooks
auth.hooks.authenticate('local', { assignProperty: 'custom' })
// when calling from middleware
auth.express.authenticate('local', { assignProperty: 'custom' })
// For sockets and all other methods you can have it in your main
// config or pass explicitly when initializing auth.
app.configure(authentication({
local: {
assignProperty: 'custom'
}
}))
```

## More warnings and debugging

Expand Down Expand Up @@ -200,4 +200,4 @@ socket.on('logout', function(tokenPayload, info) {
If you need this information in a custom route or other middleware you can access the currently authenticated entity (ie. user) and whether the request is authenticated by inspecting `req.<entity>` (ie. `req.user`) and `req.authenticated`.

### In Hooks/Services
If you need this information in a hook or service you can access the current currently authenticated entity (ie. user) and whether they are authenticated by inspecting `hook.params.<entity>` (ie. `hook.params.user`) and `hooks.params.authenticated` respectively.
If you need this information in a hook or service you can access the current currently authenticated entity (ie. user) and whether they are authenticated by inspecting `hook.params.<entity>` (ie. `hook.params.user`) and `hooks.params.authenticated` respectively.

0 comments on commit 4ab7c95

Please sign in to comment.