| title |
Auth |
| description |
Auth protocol schemas |
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
Authentication Service Protocol
Defines the standard API contracts for Identity, Session Management,
and Access Control.
**Source:** `packages/spec/src/api/auth.zod.ts`
import { AuthProvider, LoginRequest, LoginType, RefreshTokenRequest, RegisterRequest, SessionResponse, SessionUser, UserProfileResponse } from '@objectstack/spec/api';
import type { AuthProvider, LoginRequest, LoginType, RefreshTokenRequest, RegisterRequest, SessionResponse, SessionUser, UserProfileResponse } from '@objectstack/spec/api';
// Validate data
const result = AuthProvider.parse(data);
local
google
github
microsoft
ldap
saml
| Property |
Type |
Required |
Description |
| type |
Enum<'email' | 'username' | 'phone' | 'magic-link' | 'social'> |
✅ |
Login method |
| email |
string |
optional |
Required for email/magic-link |
| username |
string |
optional |
Required for username login |
| password |
string |
optional |
Required for password login |
| provider |
string |
optional |
Required for social (google, github) |
| redirectTo |
string |
optional |
Redirect URL after successful login |
email
username
phone
magic-link
social
| Property |
Type |
Required |
Description |
| refreshToken |
string |
✅ |
Refresh token |
| Property |
Type |
Required |
Description |
| email |
string |
✅ |
|
| password |
string |
✅ |
|
| name |
string |
✅ |
|
| image |
string |
optional |
|
| Property |
Type |
Required |
Description |
| success |
boolean |
✅ |
Operation success status |
| error |
{ code: string; message: string; category?: string; httpStatus?: integer; … } |
optional |
Error details if success is false |
| meta |
{ timestamp: string; duration?: number; requestId?: string; traceId?: string } |
optional |
Response metadata |
| data |
{ session: object; user: object; token?: string } |
✅ |
|
| Property |
Type |
Required |
Description |
| id |
string |
✅ |
User ID |
| email |
string |
✅ |
Email address |
| emailVerified |
boolean |
✅ |
Is email verified? |
| name |
string |
✅ |
Display name |
| image |
string |
optional |
Avatar URL |
| username |
string |
optional |
Username (optional) |
| roles |
string[] |
✅ |
Assigned role IDs |
| tenantId |
string |
optional |
Current tenant ID |
| language |
string |
✅ |
Preferred language |
| timezone |
string |
optional |
Preferred timezone |
| createdAt |
string |
optional |
|
| updatedAt |
string |
optional |
|
| Property |
Type |
Required |
Description |
| success |
boolean |
✅ |
Operation success status |
| error |
{ code: string; message: string; category?: string; httpStatus?: integer; … } |
optional |
Error details if success is false |
| meta |
{ timestamp: string; duration?: number; requestId?: string; traceId?: string } |
optional |
Response metadata |
| data |
{ id: string; email: string; emailVerified: boolean; name: string; … } |
✅ |
|