@baasix/sdk 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/auth.cjs +11 -1
- package/dist/modules/auth.cjs.map +1 -1
- package/dist/modules/auth.d.cts +8 -0
- package/dist/modules/auth.d.ts +8 -0
- package/dist/modules/auth.js +11 -1
- package/dist/modules/auth.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,8 +140,26 @@ const result = await baasix.auth.login({
|
|
|
140
140
|
password: 'password123',
|
|
141
141
|
tenantId: 'tenant-uuid',
|
|
142
142
|
});
|
|
143
|
+
|
|
144
|
+
// With authMode and authType for session management
|
|
145
|
+
const result = await baasix.auth.login({
|
|
146
|
+
email: 'user@example.com',
|
|
147
|
+
password: 'password123',
|
|
148
|
+
authMode: 'cookie', // 'jwt' (default) or 'cookie'
|
|
149
|
+
authType: 'mobile', // 'web', 'mobile', 'default', etc.
|
|
150
|
+
});
|
|
143
151
|
```
|
|
144
152
|
|
|
153
|
+
**Login Options:**
|
|
154
|
+
|
|
155
|
+
| Option | Type | Description |
|
|
156
|
+
|--------|------|-------------|
|
|
157
|
+
| `email` | string | User's email address (required) |
|
|
158
|
+
| `password` | string | User's password (required) |
|
|
159
|
+
| `tenantId` | string | Tenant ID for multi-tenant mode |
|
|
160
|
+
| `authMode` | `'jwt'` \| `'cookie'` | Authentication mode. Use `'jwt'` for token-based auth (default), `'cookie'` for cookie-based auth |
|
|
161
|
+
| `authType` | string | Session type identifier (e.g., `'web'`, `'mobile'`, `'default'`). Used for session limits and management |
|
|
162
|
+
|
|
145
163
|
### Get Current User
|
|
146
164
|
|
|
147
165
|
```typescript
|
package/dist/index.cjs
CHANGED
|
@@ -559,6 +559,14 @@ var AuthModule = class {
|
|
|
559
559
|
* password: 'password123',
|
|
560
560
|
* tenantId: 'tenant-uuid'
|
|
561
561
|
* });
|
|
562
|
+
*
|
|
563
|
+
* // Login with authMode and authType
|
|
564
|
+
* const result = await baasix.auth.login({
|
|
565
|
+
* email: 'user@example.com',
|
|
566
|
+
* password: 'password123',
|
|
567
|
+
* authMode: 'cookie', // or 'jwt' (default)
|
|
568
|
+
* authType: 'mobile' // for session management
|
|
569
|
+
* });
|
|
562
570
|
* ```
|
|
563
571
|
*/
|
|
564
572
|
async login(credentials) {
|
|
@@ -567,7 +575,9 @@ var AuthModule = class {
|
|
|
567
575
|
{
|
|
568
576
|
email: credentials.email,
|
|
569
577
|
password: credentials.password,
|
|
570
|
-
tenant_Id: credentials.tenantId
|
|
578
|
+
tenant_Id: credentials.tenantId,
|
|
579
|
+
authMode: credentials.authMode,
|
|
580
|
+
authType: credentials.authType
|
|
571
581
|
},
|
|
572
582
|
{ skipAuth: true }
|
|
573
583
|
);
|