mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 12:32:39 +00:00
Adjust validation regex for IDs
This commit is contained in:
@@ -50,7 +50,7 @@ const api = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ID Validation Checks
|
// ID Validation Checks
|
||||||
if(!id.match(/^[A-Za-z0-9_-]{12}$/)){
|
if(!id.match(/^[A-Za-z0-9_-]{7,12}$/)){
|
||||||
throw { name: 'ID Error', message: 'Invalid ID', status: 404, HBErrorCode: '11', brewId: id };
|
throw { name: 'ID Error', message: 'Invalid ID', status: 404, HBErrorCode: '11', brewId: id };
|
||||||
}
|
}
|
||||||
if(googleId && !googleId.match(/^1(?:[A-Za-z0-9+\/]{32}|[A-Za-z0-9+\/]{43})$/)){
|
if(googleId && !googleId.match(/^1(?:[A-Za-z0-9+\/]{32}|[A-Za-z0-9+\/]{43})$/)){
|
||||||
|
|||||||
Reference in New Issue
Block a user