From eb51acf7319a6207f7861a2ddc6c433662082ff4 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Wed, 21 Sep 2016 09:42:08 -0400 Subject: [PATCH] RIFT-14703: eased validation rules on ssh keys page Signed-off-by: Laurence Maultsby --- skyquake/plugins/launchpad/src/ssh_keys/sshKeyStore.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; } -- 2.25.1