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

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
@@ -1143,9 +1143,10 @@ export interface components {
1143
1143
  provider_user_id: string;
1144
1144
  };
1145
1145
  AddOrganizationMemberInput: {
1146
+ email?: string;
1146
1147
  org_id: string;
1147
1148
  role: string;
1148
- user_id: string;
1149
+ user_id?: string;
1149
1150
  };
1150
1151
  AdminListUsersResult: {
1151
1152
  Users: components["schemas"]["UserInfo"][];
@@ -1158,7 +1159,7 @@ export interface components {
1158
1159
  };
1159
1160
  ApiError: {
1160
1161
  /** @enum {string} */
1161
- error: "captcha_unavailable" | "code_already_used" | "csrf" | "email_exists" | "email_not_verified" | "forbidden" | "internal_error" | "invalid_code" | "invalid_credentials" | "invalid_input" | "invalid_link" | "invalid_request" | "invalid_token" | "last_account" | "link_already_used" | "not_found" | "oauth_account_conflict" | "oauth_email_not_verified" | "password_compromised" | "rate_limited" | "saml_connection_not_found" | "saml_invalid_assertion" | "saml_replay" | "sso_connection_not_found" | "sso_domain_not_verified" | "sso_invalid_assertion" | "two_factor_not_enabled" | "two_factor_required" | "unauthorized" | "username_taken";
1162
+ error: "captcha_unavailable" | "code_already_used" | "csrf" | "email_exists" | "email_not_verified" | "forbidden" | "internal_error" | "invalid_code" | "invalid_credentials" | "invalid_input" | "invalid_link" | "invalid_request" | "invalid_token" | "last_account" | "link_already_used" | "not_found" | "oauth_account_conflict" | "oauth_email_not_verified" | "password_compromised" | "rate_limited" | "saml_connection_not_found" | "saml_invalid_assertion" | "saml_replay" | "sso_connection_not_found" | "sso_domain_not_verified" | "sso_invalid_assertion" | "two_factor_not_enabled" | "two_factor_required" | "unauthorized" | "user_not_found" | "username_taken";
1162
1163
  message: string;
1163
1164
  };
1164
1165
  BanUserInput: {
@@ -1249,7 +1250,7 @@ export interface components {
1249
1250
  Organizations: components["schemas"]["Organization"][];
1250
1251
  };
1251
1252
  ListSessionsResult: {
1252
- Sessions: components["schemas"]["SessionInfo"][];
1253
+ sessions: components["schemas"]["SessionInfo"][];
1253
1254
  };
1254
1255
  MemberInfo: {
1255
1256
  Role: string;
@@ -1343,6 +1344,7 @@ export interface components {
1343
1344
  SessionID: string;
1344
1345
  };
1345
1346
  SAMLACSResult: {
1347
+ last_sign_in_method: string;
1346
1348
  organization_id: string;
1347
1349
  session_token: string;
1348
1350
  };
@@ -1355,6 +1357,7 @@ export interface components {
1355
1357
  url: string;
1356
1358
  };
1357
1359
  SSOCallbackResult: {
1360
+ last_sign_in_method: string;
1358
1361
  organization_id: string;
1359
1362
  session_token: string;
1360
1363
  };
@@ -1401,20 +1404,33 @@ export interface components {
1401
1404
  last_seen_at: string;
1402
1405
  /** Format: date-time */
1403
1406
  revoked_at?: string | null;
1407
+ user_agent: string;
1408
+ };
1409
+ SessionUser: {
1410
+ /** Format: date-time */
1411
+ created_at: string;
1412
+ disabled: boolean;
1413
+ email: string;
1414
+ email_verified: boolean;
1415
+ id: string;
1416
+ name: string;
1417
+ /** Format: date-time */
1418
+ updated_at: string;
1419
+ username: string;
1404
1420
  };
1405
1421
  SetActiveOrganizationInput: {
1406
1422
  org_id: string;
1407
1423
  };
1408
1424
  SignInInput: {
1409
- email: string;
1425
+ email?: string;
1410
1426
  password: string;
1411
1427
  username?: string;
1412
1428
  };
1413
1429
  SignInResult: {
1414
- SessionToken: string;
1415
- User: components["schemas"]["User"];
1416
1430
  last_sign_in_method?: string;
1431
+ session_token: string;
1417
1432
  two_factor_challenge?: string;
1433
+ user: components["schemas"]["User"];
1418
1434
  };
1419
1435
  SignOutInput: {
1420
1436
  session_token?: string;
@@ -1426,8 +1442,9 @@ export interface components {
1426
1442
  username?: string;
1427
1443
  };
1428
1444
  SignUpResult: {
1429
- User: components["schemas"]["User"];
1445
+ last_sign_in_method?: string;
1430
1446
  session_token?: string;
1447
+ user: components["schemas"]["User"];
1431
1448
  };
1432
1449
  StopImpersonatingInput: {
1433
1450
  token: string;
@@ -1472,6 +1489,7 @@ export interface components {
1472
1489
  name: string;
1473
1490
  };
1474
1491
  VerifyEmailAndSignInResult: {
1492
+ last_sign_in_method?: string;
1475
1493
  session_token?: string;
1476
1494
  user: components["schemas"]["User"];
1477
1495
  };
@@ -3325,7 +3343,7 @@ export interface operations {
3325
3343
  [name: string]: unknown;
3326
3344
  };
3327
3345
  content: {
3328
- "application/json": components["schemas"]["UserInfo"];
3346
+ "application/json": components["schemas"]["SessionUser"];
3329
3347
  };
3330
3348
  };
3331
3349
  /** @description Bad Request */
@@ -6559,6 +6577,7 @@ export interface operations {
6559
6577
  "application/json": {
6560
6578
  csrf_token?: string;
6561
6579
  error?: string;
6580
+ last_sign_in_method?: string;
6562
6581
  session_token?: string;
6563
6582
  two_factor_challenge?: string;
6564
6583
  user: components["schemas"]["User"];
@@ -7905,6 +7924,7 @@ export interface operations {
7905
7924
  };
7906
7925
  content: {
7907
7926
  "application/json": {
7927
+ last_sign_in_method: string;
7908
7928
  session_token: string;
7909
7929
  user: components["schemas"]["User"];
7910
7930
  };
@@ -8004,6 +8024,7 @@ export interface operations {
8004
8024
  };
8005
8025
  content: {
8006
8026
  "application/json": {
8027
+ last_sign_in_method: string;
8007
8028
  session_token: string;
8008
8029
  user: components["schemas"]["User"];
8009
8030
  };
@@ -8103,6 +8124,7 @@ export interface operations {
8103
8124
  };
8104
8125
  content: {
8105
8126
  "application/json": {
8127
+ last_sign_in_method: string;
8106
8128
  session_token: string;
8107
8129
  user: components["schemas"]["User"];
8108
8130
  };
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.3",
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",