【发布时间】:2013-02-04 20:20:47
【问题描述】:
大家好,我正在尝试通过电子邮件更改用户密码的方法,我当前的代码是:
<html>
<body>
<p>Hello ${userInstance.user.username}, your password will be set to ${userInstance.new_pass} to finalise your password request, please click the link below.</p>
<h2><g:link controller="reset" action="reset" params="[id:userInstance.user.id]" absolute="true">Please change my password</g:link></h2>
</body>
当前链接仅将用户 ID 参数发送到我在 grails 中的方法。我也希望将密码作为参数发送!通过此链接发送 userInstance.new_pass 的可能解决方案是什么?
附言我正在使用 grails 邮件插件。
【问题讨论】:
-
在电子邮件中发送密码在安全方面是非常非常糟糕的做法。详情请见:Is sending password to user email secure?
-
是的,这是真的.. 最好在邮件中发送更新链接
-
我知道这是一种不好的做法,我只是将其作为临时快速修复,直到完成正确的方法。