Skip to content

Commit 0cfc933

Browse files
committed
Add validation for token value when creating secure registry
This PR fixes #2428. Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent 30c1ceb commit 0cfc933

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/componentTypesView.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ export class ComponentTypesView implements TreeDataProvider<ComponentType> {
226226

227227
let token: string;
228228
if (secure === 'Yes') {
229-
token = await window.showInputBox({ placeHolder: 'Token to access the registry' });
229+
token = await window.showInputBox({
230+
placeHolder: 'Token to access the registry',
231+
validateInput: (value) => value?.trim().length > 0 ? undefined : 'Token cannot be empty'
232+
});
230233
if (!token) return null;
231234
}
232235

0 commit comments

Comments
 (0)