0

I have a React app integrated with a node.js server that has an 'invite user' flow -- a current user of the app can invite whichever email address they like, and my system will send that email address an Invite Email that will link them to a screen that has the following form in it:

<form onSubmit={this.handleSubmit}>
    <p>
        <label htmlFor="">email</label><br/>
        <input type="email" className="inpt" ref={this.input_email} value={this.state.emailText} readOnly={true}/>
    </p>

    <p>
        <label htmlFor="">name</label><br/>
        <input type="text" className="inpt" ref={this.input_name}/>
    </p>

    <p>
        <label htmlFor="">password</label><br/>
        <input type="password" className="inpt" ref={this.input_password}/>
    </p>

    <p>
        <label htmlFor="">confirm password</label><br/>
        <input type="password" className="inpt" ref={this.input_confirm_password}/>
    </p>

    <div className="btns">
        <button className="btn blue" onClick={this.acceptInvite}>create</button>
    </div>
</form>

Functionally, this form works fine -- the user fills in the form and submits it and the account is created.

The problem is that LastPass is trying to save the name rather than the email, which makes me think something in my form is not following correct standards or can in some way be improved. My login process after creating an account is email-based, not username-based. Is there something I can put in my form, in my email input, that hints to LastPass, "save this as the username"?

Omid Nikrah
  • 2,444
  • 3
  • 15
  • 30
TKoL
  • 13,158
  • 3
  • 39
  • 73
  • do last pass publish a spec for this? Also I don't know how you're submitting this form, but you don't have `name=` attributes on any of your form elements. Normally a HTML form needs these in order for the values to be passed to the server when the form is submitted. Are you doing it via AJAX and reading the values explicitly in JavaScript, maybe? We can't see that code so we don't know if there's a mistake in there, perhaps mixing the two fields up or something – ADyson Sep 28 '18 at 11:59
  • I'm not using the form as a normal submittable html form, I'm calling an API in javascript manually. But lastpass doesn't have access to that so it shouldn't matter. Lastpass only accesses the html and the values of the input elements. – TKoL Sep 28 '18 at 12:38
  • " Lastpass only accesses the html and the values of the input elements."...no all lastpass sees is the data which is _taken from the form_ and submitted to its server. You don't send HTML in a form submit. In a regular postback the browser takes the content of all form elements with a "name" attribute. Your JavaScript will be doing something similar - extracting the values from the fields and sending those values, with parameter names it chooses. – ADyson Sep 28 '18 at 12:49
  • In other words, lastpass only sees what _you send to it_, not the other way round. Check your browser's network tools, look for the request going to lastpass and see what values are actually being sent in the request, and what parameter names are given to them. And show us your JS code, if you're not sure what it's doing. And check what lastPass is actually expecting you to send, if you haven't already. – ADyson Sep 28 '18 at 13:05

0 Answers0