Skip to content

Commit d7da65d

Browse files
committed
minor changes
1 parent 0b036b1 commit d7da65d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: docs/references/backend/authenticate-request.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ It is recommended to set these options as [environment variables](/docs/deployme
6262
---
6363

6464
- `entity?`
65-
- `user` | `machine`
65+
- `user` | `machine` | `any`
6666

67-
Determines what type of authentication to perform. If set to `user`, the function will authenticate a user session. If set to `machine`, the function will authenticate a machine-to-machine request. Defaults to `user`
67+
Determines what type of authentication to perform. If set to `user`, the function will authenticate a user session. If set to `machine`, the function will authenticate a machine-to-machine request. If set to `any`, the function will authenticate both user sessions and machine-to-machine requests. Defaults to `user`.
6868

6969
---
7070

Diff for: docs/references/nextjs/auth.mdx

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `auth()` helper needs to know if it should authenticate a [session request](
1515
By passing in the `entity` parameter, you can specify the type of request you want to authenticate. By default, it will authenticate a session request.
1616

1717
> [!NOTE]
18-
> If you wnat to check **both** session and machine requests, you can pass in the `entity` parameter as `'any'`.
18+
> If you want to check **both** session and machine requests, you can pass in the `entity` parameter as `'any'`.
1919
2020
## `auth.protect()`
2121

@@ -118,6 +118,10 @@ You can use `auth()` to check if a `userId` exists. If it's null, then there is
118118

119119
You can use `auth()` to check if a user is authorized to access certain parts of your application or even entire routes by checking their roles or permissions. See detailed examples in the [dedicated guide](/docs/organizations/verify-user-permissions).
120120

121+
### Verify Machine to Machine requests
122+
123+
You can use `auth()` to verify machine to machine requests by passing in the `entity` parameter as `'machine'`. To learn more, see [machine requests](/docs/machine-requests/overview).
124+
121125
### Data fetching with `getToken()`
122126

123127
If you need to send a JWT along to a server, `getToken()` retrieves the current user's [session token](/docs/session-requests/session-tokens) or a [custom JWT template](/docs/session-requests/making/jwt-templates). See detailed examples in the [`Auth` reference](/docs/references/backend/types/auth-object#get-token).

0 commit comments

Comments
 (0)