Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复今天的几个问题 #20

Merged
merged 4 commits into from
Mar 13, 2012
Merged

修复今天的几个问题 #20

merged 4 commits into from
Mar 13, 2012

Conversation

dead-horse
Copy link
Member

  1. 登录跳转的时候,在激活页面和重置密码页面登录,直接跳转回首页。可能还有其他地方需要这样处理,可以再加到跳转首页的数组里去。
  2. 修改密码重置的逻辑。每次重置密码都随机生成一个KEY,并记录请求时间,存到数据库,生成密码重置连接发送到用户邮箱,一天之内用户通过这个链接可以直接重设密码(不再随机分配新密码),重置完后销毁key。
  3. 修改邮件发送机制,在激活和重置等需要发送邮件的时候,不再需要等待邮件发送成功再给用户反馈。

* control mailer
* @type {EventProxy}
*/
var mailEvent = new EventProxy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果队列里面还有任务未被处理完,而进程在这个时候被重启了,会怎样?数据丢失了?我先合并这个pull request,但是这个问题还是要考虑的。

fengmk2 added a commit that referenced this pull request Mar 13, 2012
修复今天的几个问题,修改找回密码逻辑,修改登录跳转逻辑;发送邮件时,不等待邮件发送成功先通知用户,避免用户等待时间过长。邮件压入队列,如果失败1分钟后再次发送
@fengmk2 fengmk2 merged commit 42d8ded into cnodejs:master Mar 13, 2012
var sender = config.mail_sender;
var to = who;
var subject = config.name + '社区密码重置';
var html = '<p>您好:<p/>' +
'<p>我们收到您在' + config.name + '社区重置密码的请求,请单击下面的链接来重置密码:</p>' +
'<p>我们收到您在' + config.name + '社区重置密码的请求,请在24小时内单击下面的链接来重置密码:</p>' +
'<a href="' + config.host + '/reset_pass?key=' + token + '&name=' + name + '">重置密码链接</a>' +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里config.host不应用依赖配置中的host,要不然本地调试配置的url就无效了。应该根据req.headers.host 来获取。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,这里我沿用的他之前的没改,我自己调试的时候还需要去改配置的host

发自我的 iPhone

在 2012-3-14,上午12:45,fengmk2 [email protected] 写道:

var sender = config.mail_sender;
var to = who;
var subject = config.name + '社区密码重置';
var html = '

您好:

' +

  •           '<p>我们收到您在' + config.name + '社区重置密码的请求,请单击下面的链接来重置密码:</p>' +
    
  •           '<p>我们收到您在' + config.name + '社区重置密码的请求,请在24小时内单击下面的链接来重置密码:</p>' +
          '<a href="' + config.host + '/reset_pass?key=' + token + '&name=' + name + '">重置密码链接</a>' +
    

这里config.host不应用依赖配置中的host,要不然本地调试配置的url就无效了。应该根据req.headers.host 来获取。


Reply to this email directly or view it on GitHub:
https://github.com/muyuan/nodeclub/pull/20/files#r552528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants