diff --git a/src/components/SshKeys/AddSshKey.js b/src/components/SshKeys/AddSshKey.js index 4a25d43a..47d399c9 100644 --- a/src/components/SshKeys/AddSshKey.js +++ b/src/components/SshKeys/AddSshKey.js @@ -1,10 +1,11 @@ import React, { useState } from 'react'; import { Mutation } from 'react-apollo'; +import { Space } from 'antd'; import Button from 'components/Button'; import Me from 'lib/query/Me'; -import AddSshKeyMutation from '../../lib/mutation/AddSshKey'; +import AddUserSSHPublicKey from '../../lib/mutation/AddUserSSHPublicKey'; const AddSshKey = ({ me: { id, email } }) => { const defaultValues = { sshKeyName: '', sshKey: '' }; @@ -15,24 +16,16 @@ const AddSshKey = ({ me: { id, email } }) => { setValues({ ...values, [name]: value }); }; - const regex = /\s*(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp256|ecdsa-sha2-nistp384|ecdsa-sha2-nistp521)\s(\S+)/; - // First capture group is the type of the ssh key - // Second capture group is the actual ssh key - // Whitespace and comments are ignored - - const isFormValid = values.sshKeyName !== '' && !values.sshKey.includes('\n') && values.sshKey.match(regex); - return (