Skip to content

Commit

Permalink
Update auth docs to not import global context (#6749)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored and jtoar committed Nov 2, 2022
1 parent da281fc commit ace8671
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions docs/docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ const Routes = () => {
## Authentication on the API Side
GraphQL requests automatically receive an `Authorization` header when a user is authenticated and Redwood will decode and verify the header, making the user available (if they are logged in) in `context.currentUser`.
`context` is a global so it's always available on your api side, like in your services.
```jsx
import { context } from '@redwoodjs/api'

console.log(context.currentUser)
// {
// sub: '<netlify-id>
Expand Down
3 changes: 1 addition & 2 deletions docs/versioned_docs/version-3.2/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ const Routes = () => {
## Authentication on the API Side
GraphQL requests automatically receive an `Authorization` header when a user is authenticated and Redwood will decode and verify the header, making the user available (if they are logged in) in `context.currentUser`.
`context` is a global so it's always available on your api side, like in your services.
```jsx
import { context } from '@redwoodjs/api'

console.log(context.currentUser)
// {
// sub: '<netlify-id>
Expand Down

0 comments on commit ace8671

Please sign in to comment.