Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add key form usability fixes #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eide
Copy link
Contributor

@eide eide commented Jan 28, 2014

  • Display error message if submit fails
  • Clear textarea on successfull submit

 - Display error message if submit fails
 - Clear textarea on successfull submit

// Format of key: algorithm (e.g. ssh-rsa), base64 encoded pubkey and an optional comment
var keyObj = input.match(/^(.+)\s((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?)(?:\s(.+))?$/);
if (!keyObj) {
console.error('Wrong format in submitted key. Example: "ssh-rsa AAAA...== user@host"');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using console.error a few other places as well (mainly fetch errors), with creating a generic error-showing-thing in mind.

Could this be generalized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants