Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/sdk/docs/services/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const auth = defineAuth("my-auth", {
usernameField: "email",
attributes: { role: true },
},
// Optional when you don't define userProfile:
// Required when you don't define userProfile (mutually exclusive with userProfile):
// machineUserAttributes: {
// role: t.string(),
// },
Expand Down
14 changes: 14 additions & 0 deletions packages/sdk/docs/services/staticwebsite.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,26 @@ export default defineConfig({

### OAuth2 Redirect URIs

The same `website.url` placeholder can be reused in `defineAuth`'s OAuth2 redirect URIs. Pick exactly one of `userProfile` or `machineUserAttributes` on `defineAuth` (they are mutually exclusive). The snippet below uses the machine-user-only shape so it compiles standalone.

```typescript
import { defineAuth, defineStaticWebSite, t } from "@tailor-platform/sdk";

const website = defineStaticWebSite("my-frontend", {
description: "Frontend application",
});

const auth = defineAuth("my-auth", {
// `machineUserAttributes` is required whenever you use `machineUsers`
// without a `userProfile`. It types every `machineUsers[*].attributes`.
machineUserAttributes: {
role: t.string(),
},
machineUsers: {
runner: {
attributes: { role: "RUNNER" },
},
},
oauth2Clients: {
"my-client": {
redirectURIs: [
Expand Down
Loading