如何防止在提交登录表单时清除我的密码
How to prevent clearing my password when login form is submitted?
我使用的是ember-simple-auth的基本配置。当我点击提交时,请求被发送到后端,但我的密码字段变为空。我的用户名字段仍然被填充。
我的模板:登录徽章
form.submit='authenticate'
Ember.TextField id='identification' valueBinding='identification'
Ember.TextField id='password' type='password' valueBinding='password'
button type='submit'
| Login
控制器:login.js
import Ember from "ember";
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';
export default Ember.Controller.extend(LoginControllerMixin, {
authenticator: "simple-auth-authenticator:oauth2-password-grant",
});
路线:login.js
import Ember from "ember";
import UnauthenticatedRouteMixin from 'simple-auth/mixins/unauthenticated-route-mixin';
export default Ember.Route.extend(UnauthenticatedRouteMixin, {
});
不使用LoginControllerMixin
的authenticate
操作,您可以简单地定义自己的:
import Ember from 'ember';
import AuthenticationControllerMixin from 'simple-auth/Authentication-controller-mixin';
export default Ember.Controller.extend(AuthenticationControllerMixin, {
authenticator: 'simple-auth-authenticator:oauth2-password-grant',
actions: {
authenticate: function() {
var data = this.getProperties('identification', 'password');
return this._super(data);
}
}
});
相关文章:
- 清除按钮不适用于我的javascript和hmtl5画布
- 清除我对这种 js 模式的想法
- 如何使用javascript刷新我的html页面时清除按钮单击
- 当我点击提交并尝试检查表单验证时,我的html表单将清除
- 如何在我的create.js.erb中重置/清除表单
- 有没有任何方法可以使用js清除浏览器缓存,至少是我的域相关文件
- JavaScript:如何清除我的自定义键盘映射并使用默认映射
- 如何编辑我的 js,以便在输出输出之前清除表单
- 我如何知道用户何时清除我的应用程序的缓存
- 为什么我的画布无法正确清除
- 如果输入了重复消息,如何清除我的 Regnum 块
- 为什么我的html img突然消失了,我需要清除缓存
- 如何防止在提交登录表单时清除我的密码
- JS函数清除我的表单变量值
- 为什么调用一个JS函数从onsubmit清除我的表单和控制台
- AutoPostBack清除我的下拉列表变量
- 不能清除我的TweenMax预加载动画完成后,所以我不能访问我的网站?我该如何解决这个问题?
- Angularjs的debounce正在清除我的无线电输入
- Javascript:为什么我可以't清除我的对象行为中的超时
- 提交后清除我的表单输入