From 6ac77f2236944acf1e3bc897908b51150463b826 Mon Sep 17 00:00:00 2001 From: "blinkagent[bot]" <237617714+blinkagent[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 03:56:38 +0000 Subject: [PATCH] feat(site): add query param support to OAuth2 app creation page (#21821) ## Summary Adds support for pre-filling the OAuth2 application creation form via URL query parameters. ## Query Parameters | Parameter | Description | |-----------|-------------| | `name` | Pre-fills the "Application name" field | | `callback_url` | Pre-fills the "Callback URL" field | | `icon` | Pre-fills the "Application icon" field | ## Example ``` /deployment/oauth2-provider/apps/add?name=MyApp&callback_url=https://example.com/callback&icon=/icon/github.svg ``` This allows external tools or documentation to link directly to the OAuth2 app creation page with pre-populated values. Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com> --- .../OAuth2AppsSettingsPage/CreateOAuth2AppPage.tsx | 10 +++++++++- .../CreateOAuth2AppPageView.tsx | 7 +++++++ .../OAuth2AppsSettingsPage/OAuth2AppForm.tsx | 12 +++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/CreateOAuth2AppPage.tsx b/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/CreateOAuth2AppPage.tsx index b94606809b..cee9d6344b 100644 --- a/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/CreateOAuth2AppPage.tsx +++ b/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/CreateOAuth2AppPage.tsx @@ -2,15 +2,22 @@ import { postApp } from "api/queries/oauth2"; import { displayError, displaySuccess } from "components/GlobalSnackbar/utils"; import type { FC } from "react"; import { useMutation, useQueryClient } from "react-query"; -import { useNavigate } from "react-router"; +import { useNavigate, useSearchParams } from "react-router"; import { pageTitle } from "utils/page"; import { CreateOAuth2AppPageView } from "./CreateOAuth2AppPageView"; const CreateOAuth2AppPage: FC = () => { const navigate = useNavigate(); + const [searchParams] = useSearchParams(); const queryClient = useQueryClient(); const postAppMutation = useMutation(postApp(queryClient)); + const defaultValues = { + name: searchParams.get("name") ?? "", + callback_url: searchParams.get("callback_url") ?? "", + icon: searchParams.get("icon") ?? "", + }; + return ( <>