From e0c1929e4b5d42f82575e95f4af09dbd81324a1b Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 16 Jul 2025 14:44:19 -0500 Subject: [PATCH] Website: Update create-android-signup-url error handling (#30956) Closes #30935 Changes: - Updated created-android-signup-url to return a bad request response if a provided callback URL cannot be used to create an Android Enterprise signup URL. --- .../api/controllers/android-proxy/create-android-signup-url.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/api/controllers/android-proxy/create-android-signup-url.js b/website/api/controllers/android-proxy/create-android-signup-url.js index 015838b43e..a2b663bcb0 100644 --- a/website/api/controllers/android-proxy/create-android-signup-url.js +++ b/website/api/controllers/android-proxy/create-android-signup-url.js @@ -18,6 +18,7 @@ module.exports = { exits: { success: { description: 'A signup URL has been sent to the requesting Fleet server.'}, enterpriseAlreadyExists: { description: 'An Android enterprise already exists for this Fleet instance.', statusCode: 409 }, + invalidCallbackUrl: { description: 'The provided callbackUrl could not be used to create an Android enterprise signup URL.', responseType: 'badRequest'} }, @@ -60,6 +61,8 @@ module.exports = { projectId: sails.config.custom.androidEnterpriseProjectId, }); return createSignupUrlResponse.data; + }).intercept({status: 400}, (unusedErr)=>{ + return {'invalidCallbackUrl': 'The provided Callback Url could not be used to create an Android enterprise signup URL.'}; }).intercept((err)=>{ return new Error(`When attempting to create a singup url for a new Android enterprise, an error occurred. Error: ${err}`); });