如何编写我的HTML登录表单以保证与LastPass一起使用,或者至少尽可能使其工作?有些网站要求"保存所有输入的数据"才能与LastPass一起正常工作,但作为网站开发人员,我正在寻找更好的方法.我需要做些什么来确保LastPass默认模式("保存站点")尽可能完美无缺?我找不到任何官方文档,或者甚至没有任何好的博客文章和建议,但这肯定会回答我的问题.理想或至少在经验上成功的标记是什么样的?
(1)证据的额外信用和/或(2)跨多个密码管理器的策略.
我使用Angular 表单在我的前端进行注册和登录。这是一个经典的设置,其中离开表单的 POST 请求被发送到后端 API。
POST 请求是从submit我(ngSubmit)=onSubmit()在form元素上注册的函数发送的。
我希望密码管理器可以玩这个:在用户创建时保存登录名/密码,登录时自动填充,密码更改时更新。
一切都可以与 Dashlane 配合使用。但是我最近尝试了 Lastpass,但它没有捕捉到请求。我在这个帮助页面上看到他们推荐使用裸表单。这对我来说不是一个选择,因为我想要一个更好的用户体验。
我的典型形式是:
<form [formGroup]="signupFormModel" (ngSubmit)="onSubmit()"...>
<input matInput
placeholder="Email"
formControlName="email"
type="email"
name="email"
autocomplete="username"
autofill>
<input matInput
placeholder="Password"
[type]="hide_password ? 'password' : 'text'"
formControlName="password"
autocomplete="new-password"
name="new-password"
autofill>
<input matInput
placeholder="Confirm password"
[type]="hide_password ? 'password' : 'text'"
formControlName="password_confirmation"
autocomplete="new-password"
name="new-password-confirmation"
autofill>
<input mat-raised-button
type="submit"
value="Sign up">
</form>
Run Code Online (Sandbox Code Playgroud)
所以你看我已经使用了autocomplete属性和正确的type& name。
我的猜测是 Lastpass 不会拦截 Submit 事件之外的请求。但这不是 Angular 表单的工作方式。(但 Dashlane …