我已经尝试了几个小时来重置密码,以便与ng-token-auth和devise-token-auth一起工作
根据文档
$auth.requestPasswordReset($scope.pwdResetForm)
.then(function(resp) {
// handle success response
})
.catch(function(resp) {
// handle error response
});ng-token-auth配置
angular.module('lessons').config ( $authProvider, RESOURCES ) ->
$authProvider.configure({
apiUrl: RESOURCES.DOMAIN
passwordResetPath: '/auth/password'
passwordUpdatePath: '/auth/password'
})应发送一封电子邮件给用户的链接,以创建一个一次性会话。我有所有的电子邮件方面的东西工作。
我现在得到了
Unpermitted parameters: redirect_url, password
Completed 401 Unauthorized我的routes.rb
scope '/api' do
mount_devise_token_auth_for 'Teacher', at: '/auth'
end我的登录/注销和其他一切都运行得很好,但我似乎不能让它工作。
我尝试过使用$http to url: "/api/auth/password"进行手动POST,但没有成功。同样的结果。
有什么帮助吗?很漂亮,请
发布于 2016-09-05 15:12:12
在application_controller.rb中尝试添加密码:
before_action :configure_permitted_parameters, if: :devise_controller?
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:password])
endhttps://stackoverflow.com/questions/39069565
复制相似问题