Comparing version 4.0.0-alpha.1 to 4.0.0-alpha.2
@@ -37,2 +37,3 @@ export * from './openid.js'; | ||
export declare enum Prompt { | ||
None = "none", | ||
/** | ||
@@ -39,0 +40,0 @@ * The Authorization Server MUST prompt the End-User for consent |
@@ -40,2 +40,3 @@ export { ReservedResource, ReservedScope, UserScope, buildOrganizationUrn, getOrganizationIdFromUrn, idTokenClaims, organizationUrnPrefix, userClaims, userinfoClaims } from './openid.js'; | ||
(function (Prompt) { | ||
Prompt["None"] = "none"; | ||
/** | ||
@@ -42,0 +43,0 @@ * The Authorization Server MUST prompt the End-User for consent |
@@ -11,5 +11,5 @@ import { Prompt } from '../consts/index.js'; | ||
resources?: string[]; | ||
prompt?: Prompt; | ||
prompt?: Prompt | Prompt[]; | ||
interactionMode?: InteractionMode; | ||
}; | ||
export declare const generateSignInUri: ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, }: SignInUriParameters) => string; |
@@ -6,2 +6,8 @@ import { QueryKey, Prompt } from '../consts/index.js'; | ||
const responseType = 'code'; | ||
const buildPrompt = (prompt) => { | ||
if (Array.isArray(prompt)) { | ||
return prompt.join(' '); | ||
} | ||
return prompt ?? Prompt.Consent; | ||
}; | ||
const generateSignInUri = ({ authorizationEndpoint, clientId, redirectUri, codeChallenge, state, scopes, resources, prompt, interactionMode, }) => { | ||
@@ -15,3 +21,3 @@ const urlSearchParameters = new URLSearchParams({ | ||
[QueryKey.ResponseType]: responseType, | ||
[QueryKey.Prompt]: prompt ?? Prompt.Consent, | ||
[QueryKey.Prompt]: buildPrompt(prompt), | ||
[QueryKey.Scope]: withDefaultScopes(scopes), | ||
@@ -18,0 +24,0 @@ }); |
{ | ||
"name": "@logto/js", | ||
"version": "4.0.0-alpha.1", | ||
"version": "4.0.0-alpha.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
65201
1485