Skip to content

Commit dcb27d3

Browse files
committed
feat(FR-2629): extend tokenLogin helper with optional extraParams
Add an optional fifth parameter `extraParams?: Record<string, string>` to the `tokenLogin` helper in `loginSessionAuth.ts`. When provided, it is forwarded to `client.token_login(sToken, extraParams)` so callers can pass additional query parameters collected from the URL (e.g. EduAppLauncher's `app`, `session_id`, `cpu`, `mem`). Existing LoginView caller remains valid since the parameter is optional and defaults to an empty object internally. This closes Open Question 1 from the spec (option (a) — extend over bypass). Refs FR-2616
1 parent 08991b0 commit dcb27d3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

react/src/helper/loginSessionAuth.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,22 @@ export async function connectViaGQL(
171171

172172
/**
173173
* Perform token-based login (SSO).
174+
*
175+
* `extraParams` are forwarded to `client.token_login` as-is. This is used by
176+
* token URL entry points that need to pass additional query parameters
177+
* collected from the URL (for example, EduAppLauncher forwards `app`,
178+
* `session_id`, resource hints) to the server-side token handler.
179+
* LoginView callers that do not need to forward anything can omit the
180+
* argument.
174181
*/
175182
export async function tokenLogin(
176183
client: any,
177184
sToken: string,
178185
cfg: LoginConfigState,
179186
endpoints: string[],
187+
extraParams?: Record<string, string>,
180188
): Promise<string[]> {
181-
const loginSuccess = await client.token_login(sToken);
189+
const loginSuccess = await client.token_login(sToken, extraParams ?? {});
182190
if (!loginSuccess) {
183191
throw new Error('Cannot authorize session by token.');
184192
}

0 commit comments

Comments
 (0)