diff --git a/hasura/metadata/actions.yaml b/hasura/metadata/actions.yaml index 7166dae1d..c6db5969d 100644 --- a/hasura/metadata/actions.yaml +++ b/hasura/metadata/actions.yaml @@ -162,7 +162,7 @@ actions: - name: reset_client_secret definition: kind: synchronous - handler: "{{NEXT_API_URL}}/hasura/reset-client-secret" + handler: '{{NEXT_API_URL}}/hasura/reset-client-secret' headers: - name: Authorization value_from_env: INTERNAL_ENDPOINTS_SECRET diff --git a/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/layout.tsx b/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/layout.tsx deleted file mode 100644 index a574768d6..000000000 --- a/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/layout.tsx +++ /dev/null @@ -1,2 +0,0 @@ -import { SignInWithWorldIdLayout } from "@/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/layout"; -export default SignInWithWorldIdLayout; diff --git a/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/page.tsx b/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/page.tsx deleted file mode 100644 index 722e42d24..000000000 --- a/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { generateMetaTitle } from "@/lib/genarate-title"; -import { SignInWithWorldIdPage } from "@/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page"; -import { Metadata } from "next"; - -export const metadata: Metadata = { - title: generateMetaTitle({ left: "Sign in with World ID" }), -}; - -export default SignInWithWorldIdPage; diff --git a/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/proof-debugging/page.tsx b/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/proof-debugging/page.tsx deleted file mode 100644 index f803854f7..000000000 --- a/web/app/(portal)/teams/[teamId]/apps/[appId]/sign-in-with-world-id/proof-debugging/page.tsx +++ /dev/null @@ -1,2 +0,0 @@ -import { SignInWithWorldIdProofDebuggingPage } from "@/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/ProofDebugging/page"; -export default SignInWithWorldIdProofDebuggingPage; diff --git a/web/lib/urls.ts b/web/lib/urls.ts index c22d38080..8e07b55b7 100644 --- a/web/lib/urls.ts +++ b/web/lib/urls.ts @@ -89,9 +89,6 @@ export const urls = { createTeam: (): "/create-team" => "/create-team", - signInWorldId: (params: { team_id: string; app_id?: string }): string => - `/teams/${params.team_id}/apps/${params.app_id}/sign-in-with-world-id`, - signUp: (): "/signup" => "/signup", login: (params?: { invite_id: string }): string => diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/ProofDebugging/page/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/ProofDebugging/page/index.tsx deleted file mode 100644 index 20fa1a7d6..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/ProofDebugging/page/index.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const SignInWithWorldIdProofDebuggingPage = () => { - return ( -
-

SignInWithWorldIdProofDebugging

-
- ); -}; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/error/error.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/error/error.tsx deleted file mode 100644 index b885107d3..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/error/error.tsx +++ /dev/null @@ -1,22 +0,0 @@ -"use client"; // Error components must be Client Components - -import { useEffect } from "react"; - -export default function Error({ - error, - reset, -}: { - error: Error & { digest?: string }; - reset: () => void; -}) { - useEffect(() => { - console.error("Sign in With World ID Error: ", error); - }, [error]); - - return ( -
-

Something went wrong!

- -
- ); -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/layout/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/layout/index.tsx deleted file mode 100644 index 3b66d54da..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/layout/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { SizingWrapper } from "@/components/SizingWrapper"; -import { ReactNode } from "react"; - -export const SignInWithWorldIdLayout = (props: { children: ReactNode }) => { - return ( -
- {props.children} -
- ); -}; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Links/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Links/index.tsx deleted file mode 100644 index 6db77024b..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Links/index.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import { DecoratedButton } from "@/components/DecoratedButton"; -import { Input } from "@/components/Input"; -import { TYPOGRAPHY, Typography } from "@/components/Typography"; -import { yupResolver } from "@hookform/resolvers/yup"; -import clsx from "clsx"; -import { memo, useCallback } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "react-toastify"; -import * as yup from "yup"; -import { SignInActionQuery } from "../../graphql/server/fetch-signin.generated"; -import { useUpdateSignInActionMutation } from "../graphql/client/update-sign-in-action.generated"; - -const schema = yup - .object({ - privacy_policy_uri: yup.string().url("Must be a valid URL").optional(), - terms_uri: yup.string().url("Must be a valid URL").optional(), - }) - .noUnknown(); - -type ClientInformation = yup.InferType; - -// This component will not be rendered if signInAction is not defined -export const LinksForm = memo(function LinksForm(props: { - teamId: string; - signInAction: SignInActionQuery["action"][0]; - canEdit: boolean; -}) { - const { teamId, signInAction, canEdit } = props; - const [updateSignInActionMutation] = useUpdateSignInActionMutation(); - - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: yupResolver(schema), - shouldFocusError: false, - defaultValues: { - privacy_policy_uri: signInAction?.privacy_policy_uri ?? "", - terms_uri: signInAction?.terms_uri ?? "", - }, - }); - - const submit = useCallback( - async (data: ClientInformation) => { - try { - if (!signInAction) return; // This should never happen - await updateSignInActionMutation({ - variables: { - id: signInAction?.id, - input: { - privacy_policy_uri: data.privacy_policy_uri, - terms_uri: data.terms_uri, - }, - }, - }); - toast.success("Links saved!"); - } catch (error) { - console.error("Update Sign in Links Error: ", error); - toast.error("Error updating action"); - } - }, - [signInAction, updateSignInActionMutation], - ); - - return ( -
-
- - Legal links - - - Links to where your Privacy Policy and Terms of Use are posted - -
- - - - - Save Changes - -
- ); -}); diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/RedirectInput/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/RedirectInput/index.tsx deleted file mode 100644 index 786617c47..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/RedirectInput/index.tsx +++ /dev/null @@ -1,121 +0,0 @@ -"use client"; -import { validateUrl } from "@/lib/utils"; -import { yupResolver } from "@hookform/resolvers/yup"; -import clsx from "clsx"; -import { InputHTMLAttributes, memo, useMemo } from "react"; -import { useForm } from "react-hook-form"; -import { twMerge } from "tailwind-merge"; -import * as yup from "yup"; - -interface InputInterface extends InputHTMLAttributes { - required?: boolean; - currentValue?: string; - placeholder?: string; - helperText?: string; - addOnRight?: React.ReactElement; - className?: string; - isStaging: boolean; - handleChange: (value: string) => void; -} - -export const RedirectInput = memo(function Input(props: InputInterface) { - const { - required, - currentValue, - helperText, - placeholder, - className, - addOnRight, - disabled, - isStaging, - handleChange, - } = props; - - const schema = useMemo( - () => - yup - .object({ - url: yup - .string() - .required("A valid url is required") - .test("is-url", "Must be a valid URL", (value) => { - return value != null ? validateUrl(value, isStaging) : true; - }), - }) - .noUnknown(), - [isStaging], - ); - - type UrlFormValues = yup.InferType; - - const { - register, - handleSubmit, - formState: { errors }, - } = useForm({ - resolver: yupResolver(schema), - mode: "onChange", - shouldFocusError: false, - defaultValues: { - url: currentValue ?? "", - }, - }); - - const parentClassNames = clsx( - "rounded-lg border-[1px] bg-grey-0 px-2 text-sm text-grey-700", - { - "border-grey-200 focus-within:border-blue-500 focus-within:hover:border-blue-500 hover:border-grey-700 ": - !errors.url && !disabled, - "border-system-error-500 text-system-error-500 focus-within:border-system-error-500": - errors.url && !disabled, - }, - { - "hover:text-grey-700": !disabled, - "bg-grey-50 text-grey-300 border-grey-200": disabled, - }, - ); - - const inputClassNames = clsx( - "peer size-full bg-transparent p-2 focus:outline-none focus:ring-0", - { - "placeholder:text-grey-400": !errors.url, - "group-hover:placeholder:text-grey-700 group-hover:focus:placeholder:text-grey-400 ": - !disabled, - }, - ); - - const handleSave = handleSubmit((data) => { - handleChange(data.url); - }); - - return ( -
-
- -
{addOnRight && addOnRight}
-
-
- {helperText && ( -

{helperText}

- )} - {errors?.url?.message && ( -

- {errors.url.message} -

- )} -
-
- ); -}); diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/delete-redirect.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/delete-redirect.generated.ts deleted file mode 100644 index d48d5e27b..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/delete-redirect.generated.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type DeleteRedirectMutationVariables = Types.Exact<{ - id: Types.Scalars["String"]["input"]; -}>; - -export type DeleteRedirectMutation = { - __typename?: "mutation_root"; - delete_redirect_by_pk?: { __typename?: "redirect"; id: string } | null; -}; - -export const DeleteRedirectDocument = gql` - mutation DeleteRedirect($id: String!) { - delete_redirect_by_pk(id: $id) { - id - } - } -`; -export type DeleteRedirectMutationFn = Apollo.MutationFunction< - DeleteRedirectMutation, - DeleteRedirectMutationVariables ->; - -/** - * __useDeleteRedirectMutation__ - * - * To run a mutation, you first call `useDeleteRedirectMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteRedirectMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteRedirectMutation, { data, loading, error }] = useDeleteRedirectMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useDeleteRedirectMutation( - baseOptions?: Apollo.MutationHookOptions< - DeleteRedirectMutation, - DeleteRedirectMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - DeleteRedirectMutation, - DeleteRedirectMutationVariables - >(DeleteRedirectDocument, options); -} -export type DeleteRedirectMutationHookResult = ReturnType< - typeof useDeleteRedirectMutation ->; -export type DeleteRedirectMutationResult = - Apollo.MutationResult; -export type DeleteRedirectMutationOptions = Apollo.BaseMutationOptions< - DeleteRedirectMutation, - DeleteRedirectMutationVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/delete-redirect.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/delete-redirect.graphql deleted file mode 100644 index 99a6667a5..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/delete-redirect.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation DeleteRedirect($id: String!) { - delete_redirect_by_pk(id: $id) { - id - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/fetch-redirect.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/fetch-redirect.generated.ts deleted file mode 100644 index aa2b3dcb9..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/fetch-redirect.generated.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type RedirectsQueryVariables = Types.Exact<{ - action_id: Types.Scalars["String"]["input"]; -}>; - -export type RedirectsQuery = { - __typename?: "query_root"; - redirect: Array<{ - __typename?: "redirect"; - id: string; - action_id: string; - redirect_uri: string; - created_at: string; - updated_at: string; - }>; -}; - -export const RedirectsDocument = gql` - query Redirects($action_id: String!) { - redirect( - where: { action_id: { _eq: $action_id } } - order_by: { created_at: asc } - ) { - id - action_id - redirect_uri - created_at - updated_at - } - } -`; - -/** - * __useRedirectsQuery__ - * - * To run a query within a React component, call `useRedirectsQuery` and pass it any options that fit your needs. - * When your component renders, `useRedirectsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useRedirectsQuery({ - * variables: { - * action_id: // value for 'action_id' - * }, - * }); - */ -export function useRedirectsQuery( - baseOptions: Apollo.QueryHookOptions< - RedirectsQuery, - RedirectsQueryVariables - > & - ( - | { variables: RedirectsQueryVariables; skip?: boolean } - | { skip: boolean } - ), -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery( - RedirectsDocument, - options, - ); -} -export function useRedirectsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - RedirectsQuery, - RedirectsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery( - RedirectsDocument, - options, - ); -} -export function useRedirectsSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions, -) { - const options = - baseOptions === Apollo.skipToken - ? baseOptions - : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery( - RedirectsDocument, - options, - ); -} -export type RedirectsQueryHookResult = ReturnType; -export type RedirectsLazyQueryHookResult = ReturnType< - typeof useRedirectsLazyQuery ->; -export type RedirectsSuspenseQueryHookResult = ReturnType< - typeof useRedirectsSuspenseQuery ->; -export type RedirectsQueryResult = Apollo.QueryResult< - RedirectsQuery, - RedirectsQueryVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/fetch-redirect.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/fetch-redirect.graphql deleted file mode 100644 index 51919e624..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/fetch-redirect.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query Redirects($action_id: String!) { - redirect( - where: { action_id: { _eq: $action_id } } - order_by: { created_at: asc } - ) { - id - action_id - redirect_uri - created_at - updated_at - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/insert-redirect.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/insert-redirect.generated.ts deleted file mode 100644 index 221158af9..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/insert-redirect.generated.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type InsertRedirectMutationVariables = Types.Exact<{ - action_id: Types.Scalars["String"]["input"]; - uri: Types.Scalars["String"]["input"]; -}>; - -export type InsertRedirectMutation = { - __typename?: "mutation_root"; - insert_redirect_one?: { - __typename?: "redirect"; - id: string; - action_id: string; - redirect_uri: string; - created_at: string; - updated_at: string; - } | null; -}; - -export const InsertRedirectDocument = gql` - mutation InsertRedirect($action_id: String!, $uri: String!) { - insert_redirect_one(object: { action_id: $action_id, redirect_uri: $uri }) { - id - action_id - redirect_uri - created_at - updated_at - } - } -`; -export type InsertRedirectMutationFn = Apollo.MutationFunction< - InsertRedirectMutation, - InsertRedirectMutationVariables ->; - -/** - * __useInsertRedirectMutation__ - * - * To run a mutation, you first call `useInsertRedirectMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useInsertRedirectMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [insertRedirectMutation, { data, loading, error }] = useInsertRedirectMutation({ - * variables: { - * action_id: // value for 'action_id' - * uri: // value for 'uri' - * }, - * }); - */ -export function useInsertRedirectMutation( - baseOptions?: Apollo.MutationHookOptions< - InsertRedirectMutation, - InsertRedirectMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - InsertRedirectMutation, - InsertRedirectMutationVariables - >(InsertRedirectDocument, options); -} -export type InsertRedirectMutationHookResult = ReturnType< - typeof useInsertRedirectMutation ->; -export type InsertRedirectMutationResult = - Apollo.MutationResult; -export type InsertRedirectMutationOptions = Apollo.BaseMutationOptions< - InsertRedirectMutation, - InsertRedirectMutationVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/insert-redirect.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/insert-redirect.graphql deleted file mode 100644 index 699b20391..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/insert-redirect.graphql +++ /dev/null @@ -1,9 +0,0 @@ -mutation InsertRedirect($action_id: String!, $uri: String!) { - insert_redirect_one(object: { action_id: $action_id, redirect_uri: $uri }) { - id - action_id - redirect_uri - created_at - updated_at - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/update-redirect.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/update-redirect.generated.ts deleted file mode 100644 index 119c3b0a8..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/update-redirect.generated.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type UpdateRedirectMutationVariables = Types.Exact<{ - id: Types.Scalars["String"]["input"]; - uri: Types.Scalars["String"]["input"]; -}>; - -export type UpdateRedirectMutation = { - __typename?: "mutation_root"; - update_redirect_by_pk?: { - __typename?: "redirect"; - id: string; - action_id: string; - redirect_uri: string; - created_at: string; - updated_at: string; - } | null; -}; - -export const UpdateRedirectDocument = gql` - mutation UpdateRedirect($id: String!, $uri: String!) { - update_redirect_by_pk( - pk_columns: { id: $id } - _set: { redirect_uri: $uri } - ) { - id - action_id - redirect_uri - created_at - updated_at - } - } -`; -export type UpdateRedirectMutationFn = Apollo.MutationFunction< - UpdateRedirectMutation, - UpdateRedirectMutationVariables ->; - -/** - * __useUpdateRedirectMutation__ - * - * To run a mutation, you first call `useUpdateRedirectMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateRedirectMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateRedirectMutation, { data, loading, error }] = useUpdateRedirectMutation({ - * variables: { - * id: // value for 'id' - * uri: // value for 'uri' - * }, - * }); - */ -export function useUpdateRedirectMutation( - baseOptions?: Apollo.MutationHookOptions< - UpdateRedirectMutation, - UpdateRedirectMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - UpdateRedirectMutation, - UpdateRedirectMutationVariables - >(UpdateRedirectDocument, options); -} -export type UpdateRedirectMutationHookResult = ReturnType< - typeof useUpdateRedirectMutation ->; -export type UpdateRedirectMutationResult = - Apollo.MutationResult; -export type UpdateRedirectMutationOptions = Apollo.BaseMutationOptions< - UpdateRedirectMutation, - UpdateRedirectMutationVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/update-redirect.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/update-redirect.graphql deleted file mode 100644 index 50cc95ec5..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/graphql/client/update-redirect.graphql +++ /dev/null @@ -1,9 +0,0 @@ -mutation UpdateRedirect($id: String!, $uri: String!) { - update_redirect_by_pk(pk_columns: { id: $id }, _set: { redirect_uri: $uri }) { - id - action_id - redirect_uri - created_at - updated_at - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/index.tsx deleted file mode 100644 index cc0b38f1e..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/Redirects/index.tsx +++ /dev/null @@ -1,181 +0,0 @@ -"use client"; - -import { Button } from "@/components/Button"; -import { DecoratedButton } from "@/components/DecoratedButton"; -import { CloseIcon } from "@/components/Icons/CloseIcon"; -import { TYPOGRAPHY, Typography } from "@/components/Typography"; -import clsx from "clsx"; -import posthog from "posthog-js"; -import { memo, useCallback, useState } from "react"; -import { toast } from "react-toastify"; -import { RedirectInput } from "./RedirectInput"; -import { useDeleteRedirectMutation } from "./graphql/client/delete-redirect.generated"; -import { - RedirectsDocument, - useRedirectsQuery, -} from "./graphql/client/fetch-redirect.generated"; -import { useInsertRedirectMutation } from "./graphql/client/insert-redirect.generated"; -import { useUpdateRedirectMutation } from "./graphql/client/update-redirect.generated"; - -export const Redirects = memo(function Redirects(props: { - actionId: string; - appId: string; - isStaging: boolean; - teamId: string; - canEdit: boolean; -}) { - const { actionId, appId, isStaging, teamId, canEdit } = props; - const [addRedirectFormShown, setAddRedirectFormShown] = useState(false); - - const { data, loading } = useRedirectsQuery({ - variables: { - action_id: actionId ?? "", - }, - }); - - const [insertRedirectMutation] = useInsertRedirectMutation(); - const [updateRedirectMutation] = useUpdateRedirectMutation(); - const [deleteRedirectMutation] = useDeleteRedirectMutation(); - - const addRedirect = useCallback( - async (redirect_uri: string) => { - try { - await insertRedirectMutation({ - variables: { - action_id: actionId, - uri: redirect_uri, - }, - - refetchQueries: [ - { - query: RedirectsDocument, - variables: { action_id: actionId }, - }, - ], - - awaitRefetchQueries: true, - }); - - setAddRedirectFormShown(false); - toast.success("Redirect added!"); - - posthog.capture("redirect_added_success", { - team_id: teamId, - app_id: appId, - }); - } catch (error) { - posthog.capture("redirect_add_failed", { - team_id: teamId, - app_id: appId, - }); - - console.error("Sign in redirects error: ", error); - toast.error("Error adding redirect"); - } - }, - [actionId, appId, insertRedirectMutation, teamId], - ); - - const deleteRedirect = useCallback( - async (id: string) => { - try { - await deleteRedirectMutation({ - variables: { - id, - }, - refetchQueries: [ - { - query: RedirectsDocument, - variables: { action_id: actionId }, - }, - ], - awaitRefetchQueries: true, - }); - toast.success("Redirect deleted!"); - } catch (error) { - console.error("Delete redirect error: ", error); - toast.error("Error deleting redirect"); - } - }, - [actionId, deleteRedirectMutation], - ); - - const redirects = data?.redirect; - - if (loading) return
; - - return ( -
- {redirects?.map((redirect) => ( - deleteRedirect(redirect.id)} - > - - - } - handleChange={(value: string) => { - if (value !== redirect.redirect_uri) { - updateRedirectMutation({ - variables: { id: redirect.id, uri: value }, - - refetchQueries: [ - { - query: RedirectsDocument, - variables: { action_id: actionId }, - }, - ], - - awaitRefetchQueries: true, - - onCompleted: () => { - toast.success("Redirect updated!"); - }, - }); - } - }} - /> - ))} - {addRedirectFormShown && ( - setAddRedirectFormShown(false)} - > - - - } - handleChange={async (value) => { - await addRedirect(value); - }} - /> - )} - setAddRedirectFormShown(true)} - > - Add another - -
- ); -}); diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/fetch-sign-in-action.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/fetch-sign-in-action.generated.ts deleted file mode 100644 index 89269062a..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/fetch-sign-in-action.generated.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type FetchSignInActionQueryVariables = Types.Exact<{ - app_id: Types.Scalars["String"]["input"]; -}>; - -export type FetchSignInActionQuery = { - __typename?: "query_root"; - action: Array<{ - __typename?: "action"; - id: string; - app_id: string; - status: string; - privacy_policy_uri?: string | null; - terms_uri?: string | null; - }>; - app: Array<{ __typename?: "app"; is_staging: boolean; created_at: string }>; -}; - -export const FetchSignInActionDocument = gql` - query FetchSignInAction($app_id: String!) { - action(where: { app_id: { _eq: $app_id }, action: { _eq: "" } }) { - id - app_id - status - privacy_policy_uri - terms_uri - } - app(where: { id: { _eq: $app_id } }) { - is_staging - created_at - } - } -`; - -/** - * __useFetchSignInActionQuery__ - * - * To run a query within a React component, call `useFetchSignInActionQuery` and pass it any options that fit your needs. - * When your component renders, `useFetchSignInActionQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useFetchSignInActionQuery({ - * variables: { - * app_id: // value for 'app_id' - * }, - * }); - */ -export function useFetchSignInActionQuery( - baseOptions: Apollo.QueryHookOptions< - FetchSignInActionQuery, - FetchSignInActionQueryVariables - > & - ( - | { variables: FetchSignInActionQueryVariables; skip?: boolean } - | { skip: boolean } - ), -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery< - FetchSignInActionQuery, - FetchSignInActionQueryVariables - >(FetchSignInActionDocument, options); -} -export function useFetchSignInActionLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - FetchSignInActionQuery, - FetchSignInActionQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery< - FetchSignInActionQuery, - FetchSignInActionQueryVariables - >(FetchSignInActionDocument, options); -} -export function useFetchSignInActionSuspenseQuery( - baseOptions?: - | Apollo.SkipToken - | Apollo.SuspenseQueryHookOptions< - FetchSignInActionQuery, - FetchSignInActionQueryVariables - >, -) { - const options = - baseOptions === Apollo.skipToken - ? baseOptions - : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery< - FetchSignInActionQuery, - FetchSignInActionQueryVariables - >(FetchSignInActionDocument, options); -} -export type FetchSignInActionQueryHookResult = ReturnType< - typeof useFetchSignInActionQuery ->; -export type FetchSignInActionLazyQueryHookResult = ReturnType< - typeof useFetchSignInActionLazyQuery ->; -export type FetchSignInActionSuspenseQueryHookResult = ReturnType< - typeof useFetchSignInActionSuspenseQuery ->; -export type FetchSignInActionQueryResult = Apollo.QueryResult< - FetchSignInActionQuery, - FetchSignInActionQueryVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/fetch-sign-in-action.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/fetch-sign-in-action.graphql deleted file mode 100644 index 839206e76..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/fetch-sign-in-action.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query FetchSignInAction($app_id: String!) { - action(where: { app_id: { _eq: $app_id }, action: { _eq: "" } }) { - id - app_id - status - privacy_policy_uri - terms_uri - } - app(where: { id: { _eq: $app_id } }) { - is_staging - created_at - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/reset-secret.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/reset-secret.generated.ts deleted file mode 100644 index 7b2b9a3fa..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/reset-secret.generated.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type ResetClientSecretMutationVariables = Types.Exact<{ - app_id: Types.Scalars["String"]["input"]; - team_id: Types.Scalars["String"]["input"]; -}>; - -export type ResetClientSecretMutation = { - __typename?: "mutation_root"; - reset_client_secret?: { - __typename?: "ResetClientOutput"; - client_secret: string; - } | null; -}; - -export const ResetClientSecretDocument = gql` - mutation ResetClientSecret($app_id: String!, $team_id: String!) { - reset_client_secret(app_id: $app_id, team_id: $team_id) { - client_secret - } - } -`; -export type ResetClientSecretMutationFn = Apollo.MutationFunction< - ResetClientSecretMutation, - ResetClientSecretMutationVariables ->; - -/** - * __useResetClientSecretMutation__ - * - * To run a mutation, you first call `useResetClientSecretMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useResetClientSecretMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [resetClientSecretMutation, { data, loading, error }] = useResetClientSecretMutation({ - * variables: { - * app_id: // value for 'app_id' - * team_id: // value for 'team_id' - * }, - * }); - */ -export function useResetClientSecretMutation( - baseOptions?: Apollo.MutationHookOptions< - ResetClientSecretMutation, - ResetClientSecretMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - ResetClientSecretMutation, - ResetClientSecretMutationVariables - >(ResetClientSecretDocument, options); -} -export type ResetClientSecretMutationHookResult = ReturnType< - typeof useResetClientSecretMutation ->; -export type ResetClientSecretMutationResult = - Apollo.MutationResult; -export type ResetClientSecretMutationOptions = Apollo.BaseMutationOptions< - ResetClientSecretMutation, - ResetClientSecretMutationVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/reset-secret.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/reset-secret.graphql deleted file mode 100644 index 901b28302..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/reset-secret.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation ResetClientSecret($app_id: String!, $team_id: String!) { - reset_client_secret(app_id: $app_id, team_id: $team_id) { - client_secret - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/update-sign-in-action.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/update-sign-in-action.generated.ts deleted file mode 100644 index 40f0eb520..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/update-sign-in-action.generated.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { gql } from "@apollo/client"; -import * as Apollo from "@apollo/client"; -const defaultOptions = {} as const; -export type UpdateSignInActionMutationVariables = Types.Exact<{ - id: Types.Scalars["String"]["input"]; - input?: Types.InputMaybe; -}>; - -export type UpdateSignInActionMutation = { - __typename?: "mutation_root"; - update_action_by_pk?: { __typename?: "action"; id: string } | null; -}; - -export const UpdateSignInActionDocument = gql` - mutation UpdateSignInAction($id: String!, $input: action_set_input) { - update_action_by_pk(pk_columns: { id: $id }, _set: $input) { - id - } - } -`; -export type UpdateSignInActionMutationFn = Apollo.MutationFunction< - UpdateSignInActionMutation, - UpdateSignInActionMutationVariables ->; - -/** - * __useUpdateSignInActionMutation__ - * - * To run a mutation, you first call `useUpdateSignInActionMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateSignInActionMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateSignInActionMutation, { data, loading, error }] = useUpdateSignInActionMutation({ - * variables: { - * id: // value for 'id' - * input: // value for 'input' - * }, - * }); - */ -export function useUpdateSignInActionMutation( - baseOptions?: Apollo.MutationHookOptions< - UpdateSignInActionMutation, - UpdateSignInActionMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - UpdateSignInActionMutation, - UpdateSignInActionMutationVariables - >(UpdateSignInActionDocument, options); -} -export type UpdateSignInActionMutationHookResult = ReturnType< - typeof useUpdateSignInActionMutation ->; -export type UpdateSignInActionMutationResult = - Apollo.MutationResult; -export type UpdateSignInActionMutationOptions = Apollo.BaseMutationOptions< - UpdateSignInActionMutation, - UpdateSignInActionMutationVariables ->; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/update-sign-in-action.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/update-sign-in-action.graphql deleted file mode 100644 index 43d4075c0..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/graphql/client/update-sign-in-action.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation UpdateSignInAction($id: String!, $input: action_set_input) { - update_action_by_pk(pk_columns: { id: $id }, _set: $input) { - id - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/index.tsx deleted file mode 100644 index ab38fbe76..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/ClientInformation/index.tsx +++ /dev/null @@ -1,198 +0,0 @@ -"use client"; -import { CopyButton } from "@/components/CopyButton"; -import { DecoratedButton } from "@/components/DecoratedButton"; -import { LockIcon } from "@/components/Icons/LockIcon"; -import { Input } from "@/components/Input"; -import { TYPOGRAPHY, Typography } from "@/components/Typography"; -import { Role_Enum } from "@/graphql/graphql"; -import { ORB_APP_TEAM_ID } from "@/lib/constants"; -import { Auth0SessionUser } from "@/lib/types"; -import { checkUserPermissions } from "@/lib/utils"; -import { useUser } from "@auth0/nextjs-auth0/client"; -import clsx from "clsx"; -import { ErrorPage } from "@/components/ErrorPage"; -import { SizingWrapper } from "@/components/SizingWrapper"; -import { useCallback, useMemo, useState } from "react"; -import Skeleton from "react-loading-skeleton"; -import { toast } from "react-toastify"; -import { LinksForm } from "./Links"; -import { Redirects } from "./Redirects"; -import { useFetchSignInActionQuery } from "./graphql/client/fetch-sign-in-action.generated"; -import { useResetClientSecretMutation } from "./graphql/client/reset-secret.generated"; - -export const ClientInformationPage = (props: { - appID: string; - teamID: string; -}) => { - const { appID, teamID } = props; - const [clientSecret, setClientSecret] = useState(""); - const { user } = useUser() as Auth0SessionUser; - - const isEnoughPermissions = useMemo(() => { - return checkUserPermissions(user, teamID ?? "", [ - Role_Enum.Owner, - Role_Enum.Admin, - ]); - }, [user, teamID]); - - const { data, loading: fetchingAction } = useFetchSignInActionQuery({ - variables: { app_id: appID }, - }); - - const signInAction = data?.action[0]; - const isStaging = data?.app[0]?.is_staging; - const createdAt = data?.app[0]?.created_at; - - // Check if app was created after September 29, 2025 - const isAppCreatedAfterCutoff = useMemo(() => { - if (teamID === ORB_APP_TEAM_ID) return false; - if (!createdAt) return false; - const cutoffDate = new Date("2025-09-29T00:00:00Z"); - const appCreatedDate = new Date(createdAt); - return appCreatedDate > cutoffDate; - }, [createdAt, teamID]); - - const [resetClientSecretMutation] = useResetClientSecretMutation({ - variables: { app_id: appID, team_id: teamID }, - }); - - const handleReset = useCallback(async () => { - try { - const result = await resetClientSecretMutation(); - - if (result instanceof Error) { - throw result; - } - - setClientSecret(result.data?.reset_client_secret?.client_secret ?? ""); - toast.success("Client secret reset"); - } catch (error) { - console.error("Reset Client Secret Error: ", error); - toast.error("Failed to reset client secret"); - } - }, [resetClientSecretMutation]); - - if (fetchingAction) { - return ( -
- -
- ); - } - - if (isAppCreatedAfterCutoff) { - return ( -
-
- Feature Not Available - - Your app was created after Sign in with World ID was deprecated and - is not eligible for this feature. Please read the announcement - above. - -
-
- ); - } - - if (!fetchingAction && !signInAction) { - return ( - - - - ); - } - - return ( -
-
-
- Client information - - - Use these attributes to configure Sign in with World ID in your app - -
- -
- } - /> - - - ) : ( - <> - ) - } - addOnRight={ -
- - Reset - - - {clientSecret !== "" && ( - - )} -
- } - /> -
-
- -
-
- - Redirects - - - - You must specify at least one URL for authentication to work - -
- - -
- - -
- ); -}; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/graphql/server/fetch-signin.generated.ts b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/graphql/server/fetch-signin.generated.ts deleted file mode 100644 index 48ef7add3..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/graphql/server/fetch-signin.generated.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* eslint-disable */ -import * as Types from "@/graphql/graphql"; - -import { GraphQLClient, RequestOptions } from "graphql-request"; -import gql from "graphql-tag"; -type GraphQLClientRequestHeaders = RequestOptions["requestHeaders"]; -export type SignInActionQueryVariables = Types.Exact<{ - app_id: Types.Scalars["String"]["input"]; -}>; - -export type SignInActionQuery = { - __typename?: "query_root"; - action: Array<{ - __typename?: "action"; - id: string; - app_id: string; - status: string; - privacy_policy_uri?: string | null; - terms_uri?: string | null; - }>; -}; - -export const SignInActionDocument = gql` - query SignInAction($app_id: String!) { - action(where: { app_id: { _eq: $app_id }, action: { _eq: "" } }) { - id - app_id - status - privacy_policy_uri - terms_uri - } - } -`; - -export type SdkFunctionWrapper = ( - action: (requestHeaders?: Record) => Promise, - operationName: string, - operationType?: string, - variables?: any, -) => Promise; - -const defaultWrapper: SdkFunctionWrapper = ( - action, - _operationName, - _operationType, - _variables, -) => action(); - -export function getSdk( - client: GraphQLClient, - withWrapper: SdkFunctionWrapper = defaultWrapper, -) { - return { - SignInAction( - variables: SignInActionQueryVariables, - requestHeaders?: GraphQLClientRequestHeaders, - ): Promise { - return withWrapper( - (wrappedRequestHeaders) => - client.request(SignInActionDocument, variables, { - ...requestHeaders, - ...wrappedRequestHeaders, - }), - "SignInAction", - "query", - variables, - ); - }, - }; -} -export type Sdk = ReturnType; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/graphql/server/fetch-signin.graphql b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/graphql/server/fetch-signin.graphql deleted file mode 100644 index 3c86c725d..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/graphql/server/fetch-signin.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query SignInAction($app_id: String!) { - action(where: { app_id: { _eq: $app_id }, action: { _eq: "" } }) { - id - app_id - status - privacy_policy_uri - terms_uri - } -} diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/index.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/index.tsx deleted file mode 100644 index 3e77fc655..000000000 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/SignInWithWorldId/page/index.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { DecoratedButton } from "@/components/DecoratedButton"; -import { DocsIcon } from "@/components/Icons/DocsIcon"; -import { GithubIcon } from "@/components/Icons/GithubIcon"; -import { WarningErrorIcon } from "@/components/Icons/WarningErrorIcon"; -import { TYPOGRAPHY, Typography } from "@/components/Typography"; -import Image from "next/image"; -import { ClientInformationPage } from "./ClientInformation"; - -type SignInWithWorldIdPageProps = { - params: Record | null | undefined; -}; -export const SignInWithWorldIdPage = async ( - props: SignInWithWorldIdPageProps, -) => { - const { params } = props; - const appId = params?.appId as `app_${string}`; - const teamId = params?.teamId as string; - - return ( -
-
- passport -
- Sign in with World ID - - Let users sign in to your app with their World ID using OpenID - Connect (OIDC) - -
-
- - - - See an example - - - - - - Learn more - - -
-
- - -
- -
-
-
- Sign in with World ID is sunsetting in{" "} - December 2025. -
-
- New apps created after September 29, 2025 cannot enable this - feature. -
-
- Read the full announcement → -
-
-
-
-
- -
-
- -
-
- ); -}; diff --git a/web/scenes/Portal/Teams/TeamId/Apps/AppId/layout/AppIdChrome.tsx b/web/scenes/Portal/Teams/TeamId/Apps/AppId/layout/AppIdChrome.tsx index 64c2c1010..d0445376d 100644 --- a/web/scenes/Portal/Teams/TeamId/Apps/AppId/layout/AppIdChrome.tsx +++ b/web/scenes/Portal/Teams/TeamId/Apps/AppId/layout/AppIdChrome.tsx @@ -6,7 +6,6 @@ import { DashboardSquareIcon } from "@/components/Icons/DashboardSquareIcon"; import { IncognitoIcon } from "@/components/Icons/IncognitoIcon"; import { SecurityIcon } from "@/components/Icons/SecurityIcon"; import { TransactionIcon } from "@/components/Icons/TransactionIcon"; -import { UserAccountIcon } from "@/components/Icons/UserAccountIcon"; import { WalletIcon } from "@/components/Icons/WalletIcon"; import { SizingWrapper } from "@/components/SizingWrapper"; import { Tab, Tabs } from "@/components/Tabs"; @@ -272,18 +271,6 @@ export const AppIdChrome = ({ Incognito actions - {!isOnChainApp && ( - - - Sign in with World ID - - - )} - - - - - { }), ); - let signInWithWorldIDCount = 0; - for (const row of response.data.action) { // Service role should not see archived actions expect(row.app_id).not.toEqual(rows[0].id); - if (row.name === "Sign in with World ID") { - signInWithWorldIDCount++; - } } - - expect(signInWithWorldIDCount).toEqual(1); // only one app with sign in with world id }); test("can query return_to fields from actions", async () => { diff --git a/web/tests/integration/app.test.ts b/web/tests/integration/app.test.ts index 56a6f3f74..587202b80 100644 --- a/web/tests/integration/app.test.ts +++ b/web/tests/integration/app.test.ts @@ -2,7 +2,6 @@ import { gql } from "@apollo/client"; import { integrationDBClean, integrationDBExecuteQuery } from "./setup"; -import { POST } from "@/api/hasura/reset-client-secret"; import { NextRequest } from "next/server"; import { getAPIClient, getAPIUserClient } from "./test-utils"; // TODO: Consider moving this to a generalized jest environment @@ -158,133 +157,6 @@ describe("user role", () => { } } }); - - test("cannot reset client secret as a member", async () => { - const { rows: teams } = (await integrationDBExecuteQuery( - `SELECT id FROM "public"."team";`, - )) as { rows: Array<{ id: string }> }; - - const { rows: teamMemberships } = (await integrationDBExecuteQuery( - `SELECT id, user_id, team_id FROM "public"."membership" WHERE "team_id" = '${teams[0].id}' AND "role" = 'MEMBER' limit 1;`, - )) as { rows: Array<{ id: string; user_id: string; team_id: string }> }; - - const { rows: teamApps } = (await integrationDBExecuteQuery( - `SELECT id FROM "public"."app" WHERE "team_id" = '${teams[0].id}' limit 1;`, - )) as { rows: Array<{ id: string }> }; - - // Test invalid role - const tokenTeamId = teams[0].id; - const tokenUserId = teamMemberships[0].user_id; - const appId = teamApps[0].id; - - const req = new NextRequest( - `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/reset-client-secret`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: process.env.INTERNAL_ENDPOINTS_SECRET!, - }, - body: JSON.stringify({ - input: { app_id: appId, team_id: tokenTeamId }, - action: { name: "reset_client_secret" }, - session_variables: { - "x-hasura-role": "user", - "x-hasura-user-id": tokenUserId, - }, - }), - }, - ); - - const res = await POST(req); - - const responseJSON = await res?.json(); - expect(responseJSON.extensions.code).toBe("insufficient_permissions"); - }); - - test("cannot reset client secret for another team", async () => { - const { rows: teams } = (await integrationDBExecuteQuery( - `SELECT id FROM "public"."team";`, - )) as { rows: Array<{ id: string }> }; - - const { rows: teamMemberships } = (await integrationDBExecuteQuery( - `SELECT id, user_id, team_id FROM "public"."membership" WHERE "team_id" = '${teams[1].id}' AND "role" = 'OWNER' limit 1;`, - )) as { rows: Array<{ id: string; user_id: string; team_id: string }> }; - - const { rows: teamApps } = (await integrationDBExecuteQuery( - `SELECT id FROM "public"."app" WHERE "team_id" = '${teams[0].id}' limit 1;`, - )) as { rows: Array<{ id: string }> }; - - const tokenTeamId = teams[1].id; - const tokenUserId = teamMemberships[0].user_id; - const appId = teamApps[0].id; - - const req = new NextRequest( - `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/reset-client-secret`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: process.env.INTERNAL_ENDPOINTS_SECRET!, - }, - body: JSON.stringify({ - input: { app_id: appId, team_id: tokenTeamId }, - action: { name: "reset_client_secret" }, - session_variables: { - "x-hasura-role": "user", - "x-hasura-user-id": tokenUserId, - }, - }), - }, - ); - - const res = await POST(req); - - const responseJSON = await res?.json(); - expect(responseJSON.extensions.code).toBe("insufficient_permissions"); - }); - - test("can reset client secret", async () => { - const { rows: teams } = (await integrationDBExecuteQuery( - `SELECT id FROM "public"."team";`, - )) as { rows: Array<{ id: string }> }; - - const { rows: teamMemberships } = (await integrationDBExecuteQuery( - `SELECT id, user_id, team_id FROM "public"."membership" WHERE "team_id" = '${teams[0].id}' AND "role" = 'OWNER' limit 1;`, - )) as { rows: Array<{ id: string; user_id: string; team_id: string }> }; - - const { rows: teamApps } = (await integrationDBExecuteQuery( - `SELECT id FROM "public"."app" WHERE "team_id" = '${teams[0].id}' limit 1;`, - )) as { rows: Array<{ id: string }> }; - - const tokenTeamId = teams[0].id; - const tokenUserId = teamMemberships[0].user_id; - const appId = teamApps[0].id; - - const req = new NextRequest( - `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/reset-client-secret`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: process.env.INTERNAL_ENDPOINTS_SECRET!, - }, - body: JSON.stringify({ - input: { app_id: appId, team_id: tokenTeamId }, - action: { name: "reset_client_secret" }, - session_variables: { - "x-hasura-role": "user", - "x-hasura-user-id": tokenUserId, - }, - }), - }, - ); - - const res = await POST(req); - - const responseJSON = await res?.json(); - expect(responseJSON.client_secret).toBeDefined(); - }); }); describe("api_key role", () => { diff --git a/web/tests/integration/team.test.ts b/web/tests/integration/team.test.ts index 1b00bb3e8..08a63255c 100644 --- a/web/tests/integration/team.test.ts +++ b/web/tests/integration/team.test.ts @@ -183,7 +183,7 @@ describe("user role", () => { const memberRoleTeamId = memberRoleMemberships[0].team_id; const req = new NextRequest( - `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/reset-client-secret`, + `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/invite-team-members`, { method: "POST", headers: { @@ -219,7 +219,7 @@ describe("user role", () => { const tokenTeamId = teams[1].id; const req = new NextRequest( - `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/reset-client-secret`, + `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/invite-team-members`, { method: "POST", headers: { @@ -255,7 +255,7 @@ describe("user role", () => { const tokenTeamId = teamMemberships[0].team_id; const req = new NextRequest( - `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/reset-client-secret`, + `${process.env.NEXT_PUBLIC_APP_URL}/api/hasura/invite-team-members`, { method: "POST", headers: {