@authsome/ui-core 0.1.8 → 0.1.9

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/dist/index.mjs CHANGED
@@ -276,6 +276,40 @@ var enLocale = {
276
276
  register: "Register passkey",
277
277
  usePasskey: "Use passkey"
278
278
  },
279
+ deviceFlow: {
280
+ title: "Authorize Device",
281
+ subtitle: "Enter the code displayed on your device",
282
+ enterCode: "Authorize Device",
283
+ enterCodeDescription: "Enter the code displayed on your device or CLI",
284
+ codeLabel: "Device Code",
285
+ codePlaceholder: "XXXX-XXXX",
286
+ codeHint: "Enter the 8-character code shown on your device",
287
+ verify: "Verify Code",
288
+ verifyCode: "Verify Code",
289
+ invalidCode: "Invalid code. Please check and try again.",
290
+ noCode: "Don't have a code?",
291
+ getCodeHelp: "Get help",
292
+ authorizationTitle: "Authorize Application",
293
+ authorizationSubtitle: "An application is requesting access to your account",
294
+ authorizeTitle: "Authorize Device",
295
+ authorizeDescription: "An application is requesting access to your account",
296
+ requestingAccess: "is requesting access to:",
297
+ codeConfirm: "Confirm this is your code:",
298
+ requestedPermissions: "Requested permissions:",
299
+ securityWarning: "Only approve this request if you initiated it",
300
+ scopes: "Requested permissions",
301
+ approve: "Approve",
302
+ deny: "Deny",
303
+ authorizedTitle: "Device Authorized",
304
+ authorizedMessage: "You can now return to your device to continue",
305
+ authorizedDescription: "Your device has been successfully authorized",
306
+ authorizedHint: "You can close this window and return to your CLI or device",
307
+ returnToCli: "Return to CLI",
308
+ deniedTitle: "Access Denied",
309
+ deniedMessage: "You have denied access to this device",
310
+ deniedDescription: "The device authorization request has been denied",
311
+ deniedHint: "You can close this window"
312
+ },
279
313
  signUp: {
280
314
  title: "Create Account",
281
315
  subtitle: "Get started with your account",
@@ -1233,6 +1267,13 @@ var FlowStep = /* @__PURE__ */ ((FlowStep2) => {
1233
1267
  FlowStep2["PASSWORD_CHANGE"] = "password_change";
1234
1268
  FlowStep2["PROFILE_UPDATE"] = "profile_update";
1235
1269
  FlowStep2["PROFILE_COMPLETE"] = "profile_complete";
1270
+ FlowStep2["DEVICE_FLOW_INITIATE"] = "device_flow_initiate";
1271
+ FlowStep2["DEVICE_CODE_ENTRY"] = "device_code_entry";
1272
+ FlowStep2["DEVICE_CODE_VERIFY"] = "device_code_verify";
1273
+ FlowStep2["DEVICE_AUTHORIZE"] = "device_authorize";
1274
+ FlowStep2["DEVICE_POLLING"] = "device_polling";
1275
+ FlowStep2["DEVICE_AUTHORIZED"] = "device_authorized";
1276
+ FlowStep2["DEVICE_DENIED"] = "device_denied";
1236
1277
  FlowStep2["SUCCESS"] = "success";
1237
1278
  FlowStep2["ERROR"] = "error";
1238
1279
  FlowStep2["CANCELLED"] = "cancelled";
@@ -1250,6 +1291,7 @@ var FlowConfigType = /* @__PURE__ */ ((FlowConfigType2) => {
1250
1291
  FlowConfigType2["SECURE_SIGN_IN_FLOW"] = "secure_sign_in_flow";
1251
1292
  FlowConfigType2["PASSWORD_RESET_FLOW"] = "password_reset_flow";
1252
1293
  FlowConfigType2["EMAIL_VERIFICATION_FLOW"] = "email_verification_flow";
1294
+ FlowConfigType2["DEVICE_FLOW"] = "device_flow";
1253
1295
  FlowConfigType2["CUSTOM"] = "custom";
1254
1296
  return FlowConfigType2;
1255
1297
  })(FlowConfigType || {});
@@ -1696,6 +1738,43 @@ var emailVerificationFlow = {
1696
1738
  }
1697
1739
  }
1698
1740
  };
1741
+ var deviceFlow = {
1742
+ name: "Device Flow",
1743
+ description: "OAuth 2.0 Device Authorization Grant for CLI/device login",
1744
+ initialStep: "device_code_entry" /* DEVICE_CODE_ENTRY */,
1745
+ allowedSteps: [
1746
+ "device_code_entry" /* DEVICE_CODE_ENTRY */,
1747
+ "device_code_verify" /* DEVICE_CODE_VERIFY */,
1748
+ "device_authorize" /* DEVICE_AUTHORIZE */,
1749
+ "device_authorized" /* DEVICE_AUTHORIZED */,
1750
+ "device_denied" /* DEVICE_DENIED */,
1751
+ "success" /* SUCCESS */,
1752
+ "error" /* ERROR */
1753
+ ],
1754
+ transitions: {
1755
+ ["device_code_entry" /* DEVICE_CODE_ENTRY */]: {
1756
+ onSuccess: "device_code_verify" /* DEVICE_CODE_VERIFY */,
1757
+ onError: "device_code_entry" /* DEVICE_CODE_ENTRY */,
1758
+ onCancel: "cancelled" /* CANCELLED */
1759
+ },
1760
+ ["device_code_verify" /* DEVICE_CODE_VERIFY */]: {
1761
+ onSuccess: "device_authorize" /* DEVICE_AUTHORIZE */,
1762
+ onError: "device_code_entry" /* DEVICE_CODE_ENTRY */,
1763
+ onBack: "device_code_entry" /* DEVICE_CODE_ENTRY */
1764
+ },
1765
+ ["device_authorize" /* DEVICE_AUTHORIZE */]: {
1766
+ onSuccess: "device_authorized" /* DEVICE_AUTHORIZED */,
1767
+ onError: "device_denied" /* DEVICE_DENIED */,
1768
+ onCancel: "device_denied" /* DEVICE_DENIED */
1769
+ },
1770
+ ["device_authorized" /* DEVICE_AUTHORIZED */]: {
1771
+ onSuccess: "success" /* SUCCESS */
1772
+ },
1773
+ ["device_denied" /* DEVICE_DENIED */]: {
1774
+ onSuccess: "error" /* ERROR */
1775
+ }
1776
+ }
1777
+ };
1699
1778
  function getFlowConfig(type) {
1700
1779
  switch (type) {
1701
1780
  case "simple_sign_in" /* SIMPLE_SIGN_IN */:
@@ -1714,6 +1793,8 @@ function getFlowConfig(type) {
1714
1793
  return passwordResetFlow;
1715
1794
  case "email_verification_flow" /* EMAIL_VERIFICATION_FLOW */:
1716
1795
  return emailVerificationFlow;
1796
+ case "device_flow" /* DEVICE_FLOW */:
1797
+ return deviceFlow;
1717
1798
  default:
1718
1799
  throw new Error(`Unknown flow type: ${type}`);
1719
1800
  }
@@ -1726,7 +1807,8 @@ var predefinedFlows = {
1726
1807
  ["phone_auth_flow" /* PHONE_AUTH_FLOW */]: phoneAuthFlow,
1727
1808
  ["oauth_sign_in" /* OAUTH_SIGN_IN */]: oauthSignInFlow,
1728
1809
  ["password_reset_flow" /* PASSWORD_RESET_FLOW */]: passwordResetFlow,
1729
- ["email_verification_flow" /* EMAIL_VERIFICATION_FLOW */]: emailVerificationFlow
1810
+ ["email_verification_flow" /* EMAIL_VERIFICATION_FLOW */]: emailVerificationFlow,
1811
+ ["device_flow" /* DEVICE_FLOW */]: deviceFlow
1730
1812
  };
1731
1813
 
1732
1814
  export { AuthClient, AuthError, AuthErrorType, AuthState, BaseAuthProvider, FlowAction, FlowConfigType, FlowEngine, FlowStep, LocalStorageAdapter, MemoryStorageAdapter, OAuthProvider, Observable, SessionStorageAdapter, TokenManager, TwoFactorMethod, completeSignUpFlow, createAuthError, createLocale, defaultLocale, emailVerificationFlow, extractCookiesFromHeaders, getFlowConfig, interpolate, isAuthError, isMFARequiredError, isNetworkError, isUnauthenticatedError, magicLinkFlow, oauthSignInFlow, parseCookie, parseCookieOptions, passwordResetFlow, phoneAuthFlow, predefinedFlows, serializeCookie, serializeCookies, signInWithMFAFlow, simpleSignInFlow, toAuthError, validate2FACode, validateEmail, validatePassword, validatePhone, validateRequired, validateUsername };