Comparing version 1.0.0 to 1.1.0
@@ -31,3 +31,4 @@ import { KeysToCamelCase, NormalizeKeyPaths, Nullable } from "@silverhand/essentials"; | ||
State = "state", | ||
Token = "token" | ||
Token = "token", | ||
InteractionMode = "interaction_mode" | ||
} | ||
@@ -82,2 +83,3 @@ export enum Prompt { | ||
export type Requester = <T>(...args: Parameters<typeof fetch>) => Promise<T>; | ||
export type InteractionMode = 'signIn' | 'signUp'; | ||
export type FetchTokenByAuthorizationCodeParameters = { | ||
@@ -197,4 +199,5 @@ clientId: string; | ||
prompt?: Prompt; | ||
interactionMode?: InteractionMode; | ||
}; | ||
export const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, }: SignInUriParameters) => string; | ||
export const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, }: SignInUriParameters) => string; | ||
type SignOutUriParameters = { | ||
@@ -201,0 +204,0 @@ endSessionEndpoint: string; |
@@ -73,2 +73,4 @@ var $eVySA$camelcasekeys = require("camelcase-keys"); | ||
QueryKey["Token"] = "token"; | ||
QueryKey[// Need to align with the OIDC extraParams settings in core | ||
"InteractionMode"] = "interaction_mode"; | ||
})($5c367c11270b61f6$export$65f63a8bc3cba53d || ($5c367c11270b61f6$export$65f63a8bc3cba53d = {})); | ||
@@ -346,3 +348,3 @@ let $5c367c11270b61f6$export$83716a4aa1642908; | ||
const $1e17092ca3413c94$var$responseType = "code"; | ||
const $1e17092ca3413c94$export$b01a187f12b774c6 = ({ authorizationEndpoint: authorizationEndpoint , clientId: clientId , redirectUri: redirectUri , codeChallenge: codeChallenge , state: state , scopes: scopes , resources: resources , prompt: prompt })=>{ | ||
const $1e17092ca3413c94$export$b01a187f12b774c6 = ({ authorizationEndpoint: authorizationEndpoint , clientId: clientId , redirectUri: redirectUri , codeChallenge: codeChallenge , state: state , scopes: scopes , resources: resources , prompt: prompt , interactionMode: interactionMode })=>{ | ||
const urlSearchParameters = new URLSearchParams({ | ||
@@ -359,2 +361,4 @@ [(0, $5c367c11270b61f6$export$65f63a8bc3cba53d).ClientId]: clientId, | ||
for (const resource of resources ?? [])urlSearchParameters.append((0, $5c367c11270b61f6$export$65f63a8bc3cba53d).Resource, resource); | ||
// Set interactionMode to signUp for a create account user experience | ||
if (interactionMode) urlSearchParameters.append((0, $5c367c11270b61f6$export$65f63a8bc3cba53d).InteractionMode, interactionMode); | ||
return `${authorizationEndpoint}?${urlSearchParameters.toString()}`; | ||
@@ -361,0 +365,0 @@ }; |
{ | ||
"name": "@logto/js", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"source": "./src/index.ts", | ||
@@ -66,3 +66,3 @@ "main": "./lib/index.js", | ||
}, | ||
"gitHead": "fff27b23a74d5bd3a46fc83fbbc2901b6e054c72" | ||
"gitHead": "f24174a6f840b8db968ad3886878d1b6e92b1b9d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
116184
910