@shakibdshy/signet-auth-client 1.0.0-beta → 1.0.0-beta.2

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 CHANGED
@@ -14,8 +14,8 @@ It attaches cookies and the CSRF token, so your frontend never builds those requ
14
14
  | **Calls that backend from a frontend** | Browser, Node.js | TypeScript, JavaScript | **`@shakibdshy/signet-auth-client`** (this package) |
15
15
  | Shares the Session with React components and guards routes (optional) | Browser | TypeScript, React | `@shakibdshy/signet-auth-react` |
16
16
 
17
- Current version: **`1.0.0-beta`**, a pre-1.0 release, so the API may still change before
18
- `v1.0.0`. The Go module (`v1.0.0-beta`) and both npm packages (`1.0.0-beta`) are released
17
+ Current version: **`1.0.0-beta.2`**, a pre-1.0 release, so the API may still change before
18
+ `v1.0.0`. The Go module (`v1.0.0-beta.2`) and both npm packages (`1.0.0-beta.2`) are released
19
19
  together at the same version.
20
20
 
21
21
  > **This package does not implement authentication.** Every request goes to the Signet
@@ -46,7 +46,7 @@ no separate auth server to install.
46
46
  ## Install
47
47
 
48
48
  ```sh
49
- npm install @shakibdshy/signet-auth-client@1.0.0-beta
49
+ npm install @shakibdshy/signet-auth-client@1.0.0-beta.2
50
50
  ```
51
51
 
52
52
  To use a change that is not published yet, install from a checkout of the repository:
@@ -81,7 +81,8 @@ await auth.signUp({
81
81
  // Sign in. The Go backend sets the Session cookie; you never handle it.
82
82
  await auth.signIn({ email: "user@example.com", password: "correct horse battery staple" });
83
83
 
84
- // Read the signed-in User.
84
+ // Read the signed-in User. The profile carries the verification state,
85
+ // the Username (empty when there is none) and the timestamps.
85
86
  const user = await auth.me();
86
87
 
87
88
  // Sign out.
@@ -132,7 +133,7 @@ The client has a typed method for most of Signet's HTTP API. The main methods by
132
133
  | --- | --- |
133
134
  | Sign-up, sign-in and sign-out | `signUp`, `signIn`, `signOut`, `me`, `lastSignInMethod` |
134
135
  | JWT Access and Refresh tokens, when the backend enables them | `exchangeToken` |
135
- | Sessions | `listSessions`, `revokeSession`, `revokeAllSessions` |
136
+ | Sessions | `listSessions`, `revokeSession`, `revokeAllSessions` — each listed Session carries `user_agent`, the raw browser header it was started from |
136
137
  | Email verification and passwords | `sendVerification`, `verifyEmail`, `sendPasswordReset`, `resetPassword`, `changePassword`, `changeEmail`, `verifyChangeEmail` |
137
138
  | Linked provider accounts | `listAccounts`, `unlinkAccount` |
138
139
  | Second factor | `enableTwoFactor`, `verifyTwoFactor`, `disableTwoFactor`, `regenerateBackupCodes` |
package/dist/schema.d.ts CHANGED
@@ -1343,6 +1343,7 @@ export interface components {
1343
1343
  SessionID: string;
1344
1344
  };
1345
1345
  SAMLACSResult: {
1346
+ last_sign_in_method: string;
1346
1347
  organization_id: string;
1347
1348
  session_token: string;
1348
1349
  };
@@ -1355,6 +1356,7 @@ export interface components {
1355
1356
  url: string;
1356
1357
  };
1357
1358
  SSOCallbackResult: {
1359
+ last_sign_in_method: string;
1358
1360
  organization_id: string;
1359
1361
  session_token: string;
1360
1362
  };
@@ -1401,12 +1403,25 @@ export interface components {
1401
1403
  last_seen_at: string;
1402
1404
  /** Format: date-time */
1403
1405
  revoked_at?: string | null;
1406
+ user_agent: string;
1407
+ };
1408
+ SessionUser: {
1409
+ /** Format: date-time */
1410
+ created_at: string;
1411
+ disabled: boolean;
1412
+ email: string;
1413
+ email_verified: boolean;
1414
+ id: string;
1415
+ name: string;
1416
+ /** Format: date-time */
1417
+ updated_at: string;
1418
+ username: string;
1404
1419
  };
1405
1420
  SetActiveOrganizationInput: {
1406
1421
  org_id: string;
1407
1422
  };
1408
1423
  SignInInput: {
1409
- email: string;
1424
+ email?: string;
1410
1425
  password: string;
1411
1426
  username?: string;
1412
1427
  };
@@ -1426,8 +1441,9 @@ export interface components {
1426
1441
  username?: string;
1427
1442
  };
1428
1443
  SignUpResult: {
1429
- User: components["schemas"]["User"];
1444
+ last_sign_in_method?: string;
1430
1445
  session_token?: string;
1446
+ user: components["schemas"]["User"];
1431
1447
  };
1432
1448
  StopImpersonatingInput: {
1433
1449
  token: string;
@@ -1472,6 +1488,7 @@ export interface components {
1472
1488
  name: string;
1473
1489
  };
1474
1490
  VerifyEmailAndSignInResult: {
1491
+ last_sign_in_method?: string;
1475
1492
  session_token?: string;
1476
1493
  user: components["schemas"]["User"];
1477
1494
  };
@@ -3325,7 +3342,7 @@ export interface operations {
3325
3342
  [name: string]: unknown;
3326
3343
  };
3327
3344
  content: {
3328
- "application/json": components["schemas"]["UserInfo"];
3345
+ "application/json": components["schemas"]["SessionUser"];
3329
3346
  };
3330
3347
  };
3331
3348
  /** @description Bad Request */
@@ -6559,6 +6576,7 @@ export interface operations {
6559
6576
  "application/json": {
6560
6577
  csrf_token?: string;
6561
6578
  error?: string;
6579
+ last_sign_in_method?: string;
6562
6580
  session_token?: string;
6563
6581
  two_factor_challenge?: string;
6564
6582
  user: components["schemas"]["User"];
@@ -7905,6 +7923,7 @@ export interface operations {
7905
7923
  };
7906
7924
  content: {
7907
7925
  "application/json": {
7926
+ last_sign_in_method: string;
7908
7927
  session_token: string;
7909
7928
  user: components["schemas"]["User"];
7910
7929
  };
@@ -8004,6 +8023,7 @@ export interface operations {
8004
8023
  };
8005
8024
  content: {
8006
8025
  "application/json": {
8026
+ last_sign_in_method: string;
8007
8027
  session_token: string;
8008
8028
  user: components["schemas"]["User"];
8009
8029
  };
@@ -8103,6 +8123,7 @@ export interface operations {
8103
8123
  };
8104
8124
  content: {
8105
8125
  "application/json": {
8126
+ last_sign_in_method: string;
8106
8127
  session_token: string;
8107
8128
  user: components["schemas"]["User"];
8108
8129
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shakibdshy/signet-auth-client",
3
- "version": "1.0.0-beta",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "Typed TypeScript client for Signet's HTTP API — the frontend half of Signet, an embeddable authentication library for Go",
5
5
  "keywords": [
6
6
  "auth",