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.
This commit is contained in:
Eric
2025-07-16 14:44:19 -05:00
committed by GitHub
parent df924f13b3
commit e0c1929e4b
@@ -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}`);
});