@logto/js 5.0.2 → 5.1.0

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.
@@ -28,13 +28,17 @@ export declare enum QueryKey {
28
28
  ResponseType = "response_type",
29
29
  Scope = "scope",
30
30
  State = "state",
31
+ /** @deprecated */
31
32
  Token = "token",
33
+ /** Need to align with the OIDC extraParams settings in core */
32
34
  InteractionMode = "interaction_mode",
33
35
  /** The query key for specifying the organization ID. */
34
36
  OrganizationId = "organization_id",
35
37
  FirstScreen = "first_screen",
36
38
  Identifier = "identifier",
37
- DirectSignIn = "direct_sign_in"
39
+ DirectSignIn = "direct_sign_in",
40
+ /** @experimental This might change in future development. Please use with caution. */
41
+ OneTimeToken = "one_time_token"
38
42
  }
39
43
  /** The prompt parameter to be used for the authorization request. */
40
44
  export declare enum Prompt {
@@ -29,14 +29,17 @@ var QueryKey;
29
29
  QueryKey["ResponseType"] = "response_type";
30
30
  QueryKey["Scope"] = "scope";
31
31
  QueryKey["State"] = "state";
32
+ /** @deprecated */
32
33
  QueryKey["Token"] = "token";
33
- // Need to align with the OIDC extraParams settings in core
34
+ /** Need to align with the OIDC extraParams settings in core */
34
35
  QueryKey["InteractionMode"] = "interaction_mode";
35
36
  /** The query key for specifying the organization ID. */
36
37
  QueryKey["OrganizationId"] = "organization_id";
37
38
  QueryKey["FirstScreen"] = "first_screen";
38
39
  QueryKey["Identifier"] = "identifier";
39
40
  QueryKey["DirectSignIn"] = "direct_sign_in";
41
+ /** @experimental This might change in future development. Please use with caution. */
42
+ QueryKey["OneTimeToken"] = "one_time_token";
40
43
  })(QueryKey || (QueryKey = {}));
41
44
  /** The prompt parameter to be used for the authorization request. */
42
45
  var Prompt;
@@ -46,10 +46,14 @@ export type SignInUriParameters = {
46
46
  interactionMode?: InteractionMode;
47
47
  /**
48
48
  * Login hint indicates the current user (usually an email address or a phone number).
49
- *
50
- * @experimental Don't use this field as it's under development.
51
49
  */
52
50
  loginHint?: string;
51
+ /**
52
+ * One-time token for the sign-in request.
53
+ *
54
+ * @experimental This might change in future development. Please use with caution.
55
+ */
56
+ oneTimeToken?: string;
53
57
  /**
54
58
  * Parameters for direct sign-in.
55
59
  *
@@ -68,5 +72,5 @@ export type SignInUriParameters = {
68
72
  */
69
73
  includeReservedScopes?: boolean;
70
74
  };
71
- export declare const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, firstScreen, identifiers: identifier, interactionMode, loginHint, directSignIn, extraParams, includeReservedScopes, }: SignInUriParameters) => string;
75
+ export declare const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, firstScreen, identifiers: identifier, interactionMode, loginHint, directSignIn, oneTimeToken, extraParams, includeReservedScopes, }: SignInUriParameters) => string;
72
76
  export {};
@@ -10,7 +10,7 @@ const buildPrompt = (prompt) => {
10
10
  return prompt ?? Prompt.Consent;
11
11
  };
12
12
  // eslint-disable-next-line complexity
13
- const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, firstScreen, identifiers: identifier, interactionMode, loginHint, directSignIn, extraParams, includeReservedScopes = true, }) => {
13
+ const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, firstScreen, identifiers: identifier, interactionMode, loginHint, directSignIn, oneTimeToken, extraParams, includeReservedScopes = true, }) => {
14
14
  const urlSearchParameters = new URLSearchParams({
15
15
  [QueryKey.ClientId]: clientId,
16
16
  [QueryKey.RedirectUri]: redirectUri,
@@ -43,6 +43,9 @@ const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeC
43
43
  if (identifier && identifier.length > 0) {
44
44
  urlSearchParameters.append(QueryKey.Identifier, identifier.join(' '));
45
45
  }
46
+ if (oneTimeToken) {
47
+ urlSearchParameters.append(QueryKey.OneTimeToken, oneTimeToken);
48
+ }
46
49
  if (extraParams) {
47
50
  for (const [key, value] of Object.entries(extraParams)) {
48
51
  urlSearchParameters.append(key, value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/js",
3
- "version": "5.0.2",
3
+ "version": "5.1.0",
4
4
  "type": "module",
5
5
  "module": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -25,16 +25,16 @@
25
25
  "@silverhand/eslint-config": "^6.0.1",
26
26
  "@silverhand/ts-config": "^6.0.0",
27
27
  "@types/node": "^22.0.0",
28
- "@vitest/coverage-v8": "^1.6.0",
28
+ "@vitest/coverage-v8": "^2.1.9",
29
29
  "angular-auth-oidc-client": "^19.0.0",
30
30
  "eslint": "^8.57.0",
31
- "happy-dom": "^15.10.2",
31
+ "happy-dom": "^16.0.0",
32
32
  "jose": "^5.2.2",
33
33
  "lint-staged": "^15.0.0",
34
34
  "prettier": "^3.0.0",
35
35
  "rollup": "^4.22.4",
36
36
  "typescript": "^5.3.3",
37
- "vitest": "^1.6.0"
37
+ "vitest": "^2.1.9"
38
38
  },
39
39
  "eslintConfig": {
40
40
  "extends": "@silverhand"