FIX: Store user's id instead for sending activation email.

* Email and username are both allowed to be used for logging in.
  Therefore, it is easier to just store the user's id rather than
  to store the username and email in the session.
This commit is contained in:
Guo Xiang Tan
2017-03-13 20:20:25 +08:00
parent 7ebfa3c901
commit 9364d8ce71
3 changed files with 21 additions and 12 deletions

View File

@ -278,7 +278,7 @@ class SessionController < ApplicationController
end
def not_activated(user)
session[ACTIVATE_USER_KEY] = user.username
session[ACTIVATE_USER_KEY] = user.id
render json: {
error: I18n.t("login.not_activated"),
reason: 'not_activated',