Skip to content

Commit

Permalink
feat: add docs for middleware-based sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed Jul 30, 2020
1 parent 7d49953 commit 951408a
Show file tree
Hide file tree
Showing 8 changed files with 1,619 additions and 572 deletions.
6 changes: 6 additions & 0 deletions docs/site/Authentication-component-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ sidebar: lb4_sidebar
permalink: /doc/en/lb4/Authentication-component-action.html
---

{% include note.html content="
This is not needed for [middleware-based
sequence](REST-middleware-sequence.md) as the authentication is enforced by a
middleware that's automatically discovered and added to the sequence.
" %}

## Adding an Authentication Action to a Custom Sequence

In a LoopBack 4 application with REST API endpoints, each request passes through
Expand Down
6 changes: 6 additions & 0 deletions docs/site/Authentication-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ snippet:
- Decorate the controller endpoint with `@authenticate()` and inject the user
passed from the authentication layer.

{% include note.html content="
For [middleware-based sequence](REST-middleware-sequence.md), there is no longer
needed to add the authenticate action as the authentication is enforced by a
middleware that's automatically discovered and added to the sequence.
" %}

The rest will be handled by the authentication component
`@loopback/authentication`, which incorporates the authentication mechanism, and
the JWT extension `@loopback/jwt-authentication`, which helps in implementing
Expand Down
Loading

0 comments on commit 951408a

Please sign in to comment.