diff --git a/api/accessPrompt.ts b/api/accessPrompt.ts index 1bab034..e071583 100644 --- a/api/accessPrompt.ts +++ b/api/accessPrompt.ts @@ -36,14 +36,14 @@ export const getAccessPromptResource = async ( export const requestAccessPrompt = async (params: { resource: string; - accessPromptUrl: string; + client: string; }): Promise => { await makeApiRequest( "accessprompt", "POST", JSON.stringify({ resource: params.resource, - accessPromptUrl: params.accessPromptUrl, + client: params.client, }) ); }; diff --git a/app/access-prompt/index.tsx b/app/access-prompt/index.tsx index e45a651..e0c09ca 100644 --- a/app/access-prompt/index.tsx +++ b/app/access-prompt/index.tsx @@ -37,15 +37,15 @@ import CardInfo from "@/components/common/CardInfo"; import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome"; const Page: React.FC = () => { - const { webId, type, accessPromptUrl } = useLocalSearchParams(); + const { webId, client, type } = useLocalSearchParams(); const router = useRouter(); const { data } = useQuery({ queryKey: ["accessPromptResource"], queryFn: () => getAccessPromptResource({ type: type as string, + client: client as string, webId: webId as string, - accessPromptUrl: accessPromptUrl as string, }), }); const navigation = useNavigation(); @@ -75,7 +75,7 @@ const Page: React.FC = () => { if (!data) return; mutation.mutate({ resource: data.resource, - accessPromptUrl: accessPromptUrl as string, + client: client as string, }); router.replace({ pathname: "/access-prompt/confirmed", diff --git a/app/scan-qr.tsx b/app/scan-qr.tsx index 2a722bd..67d0272 100644 --- a/app/scan-qr.tsx +++ b/app/scan-qr.tsx @@ -45,16 +45,12 @@ export default function Logout() { setScanned(true); try { const resourceInfo = JSON.parse(data); - if ( - resourceInfo.webId && - resourceInfo.accessPromptUrl && - resourceInfo.type - ) { + if (resourceInfo.webId && resourceInfo.client && resourceInfo.type) { replace({ pathname: "/access-prompt", params: { webId: resourceInfo.webId, - accessPromptUrl: resourceInfo.accessPromptUrl, + client: resourceInfo.client, type: resourceInfo.type, }, }); diff --git a/types/accessPrompt.ts b/types/accessPrompt.ts index ec9e567..8ff4fce 100644 --- a/types/accessPrompt.ts +++ b/types/accessPrompt.ts @@ -20,13 +20,12 @@ // export interface AccessPromptQR { webId: string; - accessPromptUrl: string; + client: string; type: string; } export interface AccessPromptResource { webId: string; - accessPromptUrl: string; resource: string; resourceName: string; logo: string;