Fix jwt-token
This commit is contained in:
@@ -641,13 +641,17 @@ const DeviceModal = ({ device, onClose, onSave }) => {
|
|||||||
Device ID *
|
Device ID *
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="text"
|
||||||
name="id"
|
name="id"
|
||||||
required
|
required
|
||||||
|
placeholder="e.g. device-001 or sensor-alpha-123"
|
||||||
className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500"
|
className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500"
|
||||||
value={formData.id}
|
value={formData.id}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
|
<p className="text-xs text-gray-500 mt-1">
|
||||||
|
Enter a unique identifier for the device (letters, numbers, dashes allowed)
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const multiAuth = new MultiTenantAuth();
|
|||||||
|
|
||||||
// Validation schema for device
|
// Validation schema for device
|
||||||
const deviceSchema = Joi.object({
|
const deviceSchema = Joi.object({
|
||||||
id: Joi.number().integer().required().min(1).max(999999999), // Device ID is required for manual registration
|
id: Joi.string().required().min(1).max(255), // Device ID is required for manual registration - can be string or number
|
||||||
name: Joi.string().max(255).allow('').optional(),
|
name: Joi.string().max(255).allow('').optional(),
|
||||||
geo_lat: Joi.number().min(-90).max(90).optional(),
|
geo_lat: Joi.number().min(-90).max(90).optional(),
|
||||||
geo_lon: Joi.number().min(-180).max(180).optional(),
|
geo_lon: Joi.number().min(-180).max(180).optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user