mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 22:25:24 +00:00
Changed way to set authenticationToken as required when webServiceURL is provided
This commit is contained in:
@@ -19,10 +19,9 @@ let supportedOptions = Joi.object().keys({
|
|||||||
serialNumber: Joi.string(),
|
serialNumber: Joi.string(),
|
||||||
userInfo: Joi.alternatives(Joi.object().unknown(), Joi.array()),
|
userInfo: Joi.alternatives(Joi.object().unknown(), Joi.array()),
|
||||||
webServiceURL: Joi.string().regex(/^https?:\/\/(?:[a-z0-9]+\.[a-z0-9]+\.[a-z]+(?:\.[a-z]+)?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\/?(?:[a-z\/_%0-9A-Z.]+)?/),
|
webServiceURL: Joi.string().regex(/^https?:\/\/(?:[a-z0-9]+\.[a-z0-9]+\.[a-z]+(?:\.[a-z]+)?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\/?(?:[a-z\/_%0-9A-Z.]+)?/),
|
||||||
authenticationToken: Joi.when("webServiceURL", {
|
authenticationToken: Joi.string().token().min(16).when("webServiceURL", {
|
||||||
is: Joi.exist(),
|
is: Joi.exist(),
|
||||||
then: Joi.string().token().min(16).required(),
|
then: Joi.required()
|
||||||
otherwise: Joi.string().token().min(16)
|
|
||||||
}),
|
}),
|
||||||
backgroundColor: Joi.string().min(10).max(16),
|
backgroundColor: Joi.string().min(10).max(16),
|
||||||
foregroundColor: Joi.string().min(10).max(16),
|
foregroundColor: Joi.string().min(10).max(16),
|
||||||
|
|||||||
Reference in New Issue
Block a user