@@ -74,7 +74,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
7474 return res . status ( 404 ) . send ( 'clientId is required' )
7575 }
7676
77- const config = await processor . safeGetConfig ( )
77+ const config = await processor . safeGetConfig ( true )
7878 ArcGISIdentityManager . authorize ( {
7979 clientId,
8080 portal : getPortalUrl ( url ) ,
@@ -95,7 +95,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
9595 return res . sendStatus ( 500 )
9696 }
9797
98- const config = await processor . safeGetConfig ( )
98+ const config = await processor . safeGetConfig ( true )
9999 const creds = {
100100 clientId : state . clientId ,
101101 redirectUri : `${ config . baseUrl } /${ pluginWebRoute } /oauth/authenticate` ,
@@ -161,7 +161,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
161161 } )
162162
163163 routes . post ( '/featureService/validate' , async ( req , res ) => {
164- const config = await processor . safeGetConfig ( )
164+ const config = await processor . safeGetConfig ( true )
165165 const { url, auth = { } } = req . body
166166 const { token, username, password } = auth
167167 if ( ! URL . canParse ( url ) ) {
@@ -188,15 +188,15 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
188188 }
189189 console . log ( 'values patch' )
190190 await processor . patchConfig ( config )
191- return res . send ( service )
191+ return res . send ( processor . sanitizeFeatureService ( service , AuthType . OAuth ) )
192192 } catch ( err ) {
193193 return res . send ( 'Invalid credentials provided to communicate with feature service' ) . status ( 400 )
194194 }
195195 } )
196196
197197 routes . get ( '/featureService/layers' , async ( req , res , next ) => {
198198 const url = req . query . featureServiceUrl as string
199- const config = await processor . safeGetConfig ( )
199+ const config = await processor . safeGetConfig ( true )
200200 const featureService = config . featureServices . find ( featureService => featureService . url === url )
201201 if ( ! featureService ) {
202202 return res . status ( 400 )
0 commit comments