@@ -18,6 +18,7 @@ import { retryFor, throwCanisterError, waitForStore } from "$lib/utils/utils";
1818import { z } from "zod" ;
1919import type { ChannelError } from "$lib/stores/channelStore" ;
2020
21+
2122/**
2223 * Resolves the config issuer string from the current authentication state.
2324 * Returns `undefined` if the user did not authenticate via OpenID.
@@ -76,14 +77,6 @@ export const handleLegacyAttributes =
7677 dapp ?. certifiedAttributes !== true &&
7778 frontendCanisterConfig . fetch_root_key [ 0 ] !== true
7879 ) {
79- await channel . send ( {
80- jsonrpc : "2.0" ,
81- id : request . id ,
82- error : {
83- code : INVALID_PARAMS_ERROR_CODE ,
84- message : "Attributes are not available for this origin." ,
85- } ,
86- } ) ;
8780 return ;
8881 }
8982
@@ -103,14 +96,6 @@ export const handleLegacyAttributes =
10396 derivationOrigin : paramsResult . data . icrc95DerivationOrigin ,
10497 } ) ;
10598 if ( validationResult . result === "invalid" ) {
106- await channel . send ( {
107- jsonrpc : "2.0" ,
108- id : request . id ,
109- error : {
110- code : INVALID_PARAMS_ERROR_CODE ,
111- message : "Unverified derivation origin" ,
112- } ,
113- } ) ;
11499 onError ( "unverified-origin" ) ;
115100 return ;
116101 }
@@ -175,15 +160,6 @@ export const handleLegacyAttributes =
175160 } ) ;
176161 } catch ( error ) {
177162 console . error ( error ) ;
178- await channel . send ( {
179- jsonrpc : "2.0" ,
180- id : request . id ,
181- error : {
182- code : 1000 ,
183- message :
184- "Encountered an internal error while processing the request." ,
185- } ,
186- } ) ;
187163 }
188164 } ;
189165
@@ -220,14 +196,6 @@ export const handleIcrc3Attributes =
220196 dapp ?. certifiedAttributes !== true &&
221197 frontendCanisterConfig . fetch_root_key [ 0 ] !== true
222198 ) {
223- await channel . send ( {
224- jsonrpc : "2.0" ,
225- id : request . id ,
226- error : {
227- code : INVALID_PARAMS_ERROR_CODE ,
228- message : "Attributes are not available for this origin." ,
229- } ,
230- } ) ;
231199 return ;
232200 }
233201
@@ -247,14 +215,6 @@ export const handleIcrc3Attributes =
247215 derivationOrigin : paramsResult . data . icrc95DerivationOrigin ,
248216 } ) ;
249217 if ( validationResult . result === "invalid" ) {
250- await channel . send ( {
251- jsonrpc : "2.0" ,
252- id : request . id ,
253- error : {
254- code : INVALID_PARAMS_ERROR_CODE ,
255- message : "Unverified derivation origin" ,
256- } ,
257- } ) ;
258218 onError ( "unverified-origin" ) ;
259219 return ;
260220 }
@@ -311,14 +271,5 @@ export const handleIcrc3Attributes =
311271 } ) ;
312272 } catch ( error ) {
313273 console . error ( error ) ;
314- await channel . send ( {
315- jsonrpc : "2.0" ,
316- id : request . id ,
317- error : {
318- code : 1000 ,
319- message :
320- "Encountered an internal error while processing the request." ,
321- } ,
322- } ) ;
323274 }
324275 } ;
0 commit comments