@logto/js 4.0.0 → 4.0.1

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.
@@ -22,6 +22,7 @@ exports.QueryKey = void 0;
22
22
  QueryKey["GrantType"] = "grant_type";
23
23
  QueryKey["IdToken"] = "id_token";
24
24
  QueryKey["IdTokenHint"] = "id_token_hint";
25
+ QueryKey["LoginHint"] = "login_hint";
25
26
  QueryKey["PostLogoutRedirectUri"] = "post_logout_redirect_uri";
26
27
  QueryKey["Prompt"] = "prompt";
27
28
  QueryKey["RedirectUri"] = "redirect_uri";
@@ -19,6 +19,7 @@ export declare enum QueryKey {
19
19
  GrantType = "grant_type",
20
20
  IdToken = "id_token",
21
21
  IdTokenHint = "id_token_hint",
22
+ LoginHint = "login_hint",
22
23
  PostLogoutRedirectUri = "post_logout_redirect_uri",
23
24
  Prompt = "prompt",
24
25
  RedirectUri = "redirect_uri",
@@ -20,6 +20,7 @@ var QueryKey;
20
20
  QueryKey["GrantType"] = "grant_type";
21
21
  QueryKey["IdToken"] = "id_token";
22
22
  QueryKey["IdTokenHint"] = "id_token_hint";
23
+ QueryKey["LoginHint"] = "login_hint";
23
24
  QueryKey["PostLogoutRedirectUri"] = "post_logout_redirect_uri";
24
25
  QueryKey["Prompt"] = "prompt";
25
26
  QueryKey["RedirectUri"] = "redirect_uri";
@@ -11,7 +11,7 @@ const buildPrompt = (prompt) => {
11
11
  }
12
12
  return prompt ?? index.Prompt.Consent;
13
13
  };
14
- const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes: scopes$1, resources, prompt, interactionMode, }) => {
14
+ const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes: scopes$1, resources, prompt, interactionMode, loginHint, }) => {
15
15
  const urlSearchParameters = new URLSearchParams({
16
16
  [index.QueryKey.ClientId]: clientId,
17
17
  [index.QueryKey.RedirectUri]: redirectUri,
@@ -22,6 +22,9 @@ const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeC
22
22
  [index.QueryKey.Prompt]: buildPrompt(prompt),
23
23
  [index.QueryKey.Scope]: scopes.withDefaultScopes(scopes$1),
24
24
  });
25
+ if (loginHint) {
26
+ urlSearchParameters.append(index.QueryKey.LoginHint, loginHint);
27
+ }
25
28
  for (const resource of resources ?? []) {
26
29
  urlSearchParameters.append(index.QueryKey.Resource, resource);
27
30
  }
@@ -10,5 +10,6 @@ export type SignInUriParameters = {
10
10
  resources?: string[];
11
11
  prompt?: Prompt | Prompt[];
12
12
  interactionMode?: InteractionMode;
13
+ loginHint?: string;
13
14
  };
14
- export declare const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, }: SignInUriParameters) => string;
15
+ export declare const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, loginHint, }: SignInUriParameters) => string;
@@ -9,7 +9,7 @@ const buildPrompt = (prompt) => {
9
9
  }
10
10
  return prompt ?? Prompt.Consent;
11
11
  };
12
- const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, }) => {
12
+ const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, loginHint, }) => {
13
13
  const urlSearchParameters = new URLSearchParams({
14
14
  [QueryKey.ClientId]: clientId,
15
15
  [QueryKey.RedirectUri]: redirectUri,
@@ -20,6 +20,9 @@ const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeC
20
20
  [QueryKey.Prompt]: buildPrompt(prompt),
21
21
  [QueryKey.Scope]: withDefaultScopes(scopes),
22
22
  });
23
+ if (loginHint) {
24
+ urlSearchParameters.append(QueryKey.LoginHint, loginHint);
25
+ }
23
26
  for (const resource of resources ?? []) {
24
27
  urlSearchParameters.append(QueryKey.Resource, resource);
25
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/js",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "type": "module",
5
5
  "main": "./lib/index.cjs",
6
6
  "module": "./lib/index.js",