From 9257cf708635514d553696f5e5f0650d36b652a9 Mon Sep 17 00:00:00 2001 From: mffap Date: Wed, 22 Mar 2023 09:19:19 +0200 Subject: [PATCH] docs(playground): save to clipboard (#5488) * docs(playground): permanent link * add scope urn:zitadel:iam:org:project:roles * remove window * remove copy * move to top right of card, fresh lockfile * remove scope * copy to clipboard * browser only * cleanup * try with plausible css * remove plausible plugin * remove plausible window * fix plausible in preview * plausible script --------- Co-authored-by: Max Peintner Co-authored-by: Florian Forster --- docs/docs/apis/openidoauth/authrequest.mdx | 30 +- docs/package.json | 2 +- docs/src/components/authrequest.jsx | 81 +++- docs/src/components/list.jsx | 5 - docs/vercel.json | 13 +- docs/yarn.lock | 511 ++++++++++++--------- 6 files changed, 394 insertions(+), 248 deletions(-) diff --git a/docs/docs/apis/openidoauth/authrequest.mdx b/docs/docs/apis/openidoauth/authrequest.mdx index 2f04c54b07..d352a09b8a 100644 --- a/docs/docs/apis/openidoauth/authrequest.mdx +++ b/docs/docs/apis/openidoauth/authrequest.mdx @@ -42,9 +42,9 @@ The Instance Domain to your ZITADEL ins

- Response Type defines whether a - code, id_token token or just id_token will be returned. Most use cases will - need code. + Response Type defines whether a code, + id_token token or just id_token will be returned. Most use cases will need + code.

More in the documentation about required Parameters. @@ -63,16 +63,26 @@ More in the [documentation](/apis/openidoauth/authn-methods) about authenticatio ### Additional Parameters -

+

Prompt defines if and how the user - should be prompted on login. For example: + should be prompted on login. For example:
    -
  • select_account: user is prompted to select one of the existing sessions or create a new one
  • -
  • create: present the register form
  • -
  • login: requires the user to re-authenticate
  • -
  • none: user must be authenticated without interaction, an error is returned otherwise; use for silent-refresh
  • +
  • + select_account: user is prompted to select one of the + existing sessions or create a new one +
  • +
  • + create: present the register form +
  • +
  • + login: requires the user to re-authenticate +
  • +
  • + none: user must be authenticated without interaction, an + error is returned otherwise; use for silent-refresh +
-

+

Login hint must be a valid logon name diff --git a/docs/package.json b/docs/package.json index 849f44876a..02263269fe 100644 --- a/docs/package.json +++ b/docs/package.json @@ -94,7 +94,6 @@ "dns-packet": "5.3.1", "docusaurus-plugin-image-zoom": "^0.1.1", "docusaurus-plugin-openapi-docs": "1.5.2", - "docusaurus-plugin-plausible": "^0.0.5", "docusaurus-theme-openapi-docs": "1.5.2", "eastasianwidth": "0.2.0", "enhanced-resolve": "5.9.3", @@ -155,6 +154,7 @@ "raw-body": "2.5.1", "raw-loader": "^4.0.2", "react": "^17.0.2", + "react-copy-to-clipboard": "^5.1.0", "react-dev-utils": "12.0.1", "react-dom": "^17.0.2", "react-error-overlay": "6.0.11", diff --git a/docs/src/components/authrequest.jsx b/docs/src/components/authrequest.jsx index 833453aa7b..71fd1349ea 100644 --- a/docs/src/components/authrequest.jsx +++ b/docs/src/components/authrequest.jsx @@ -5,6 +5,64 @@ import { Transition } from "@headlessui/react"; import { ChevronUpDownIcon, CheckIcon } from "@heroicons/react/24/solid"; import clsx from "clsx"; import { Buffer } from "buffer"; +import { CopyToClipboard } from "react-copy-to-clipboard"; +import BrowserOnly from "@docusaurus/BrowserOnly"; + +const LinkButton = ({ + instance, + clientId, + redirectUri, + responseType, + prompt, + organizationId, + authMethod, + codeVerifier, + scope, + loginHint, + idTokenHint, +}) => { + const [copied, setCopied] = useState(false); + + return ( + { + setCopied(true); + setTimeout(() => { + setCopied(false); + }, 2000); + }} + > + + + ); +}; export function SetAuthRequest() { const { @@ -116,7 +174,26 @@ export function SetAuthRequest() { return (

-
Your Domain
+
+
Your Domain
+ + {() => ( + + )} + +