From: Laurence Maultsby Date: Wed, 21 Sep 2016 13:42:08 +0000 (-0400) Subject: RIFT-14703: eased validation rules on ssh keys page X-Git-Tag: v1.0.0~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F72%2F372%2F1;p=osm%2FUI.git RIFT-14703: eased validation rules on ssh keys page Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/plugins/launchpad/src/ssh_keys/sshKeyStore.js b/skyquake/plugins/launchpad/src/ssh_keys/sshKeyStore.js index 400c0968e..7ae421b8c 100644 --- a/skyquake/plugins/launchpad/src/ssh_keys/sshKeyStore.js +++ b/skyquake/plugins/launchpad/src/ssh_keys/sshKeyStore.js @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -174,10 +174,8 @@ export default class SshKeyStore { return {key: payload.key, name: payload.name}; } validate(data) { - for (let k in data) { - if((data[k].trim() == '') || ((/[^\w _-]/).test(data[k]))) { - return false; - } + if((data['name'].trim() == '') || ((/[^\w _-]/).test(data['name']))) { + return false; } return true; }