feat(docs): document first-admin bootstrap flow and update authentication examples
This commit is contained in:
@@ -27,7 +27,7 @@ const client = new DcRouterApiClient({
|
||||
baseUrl: 'https://dcrouter.example.com',
|
||||
});
|
||||
|
||||
await client.login('admin', 'admin');
|
||||
await client.login('admin@example.com', 'strong-password');
|
||||
|
||||
const { routes, warnings } = await client.routes.list();
|
||||
console.log(routes.length, warnings.length);
|
||||
@@ -43,13 +43,13 @@ await route.toggle(true);
|
||||
|
||||
## Authentication
|
||||
|
||||
The client supports session login and API-token authentication.
|
||||
The client supports persisted-admin session login and API-token authentication. Initial admin creation is a bootstrap flow exposed by the Ops dashboard and raw TypedRequest contracts; after a persisted admin exists, use that account with `login()`.
|
||||
|
||||
```typescript
|
||||
const sessionClient = new DcRouterApiClient({
|
||||
baseUrl: 'https://dcrouter.example.com',
|
||||
});
|
||||
await sessionClient.login('admin', 'admin');
|
||||
await sessionClient.login('admin@example.com', 'strong-password');
|
||||
|
||||
const tokenClient = new DcRouterApiClient({
|
||||
baseUrl: 'https://dcrouter.example.com',
|
||||
@@ -153,7 +153,7 @@ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark G
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Task Venture Capital GmbH
|
||||
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||||
|
||||
Reference in New Issue
Block a user