|
|
|
@ -127,21 +127,21 @@ class AccountsController < ApplicationController
|
|
|
|
|
# UserDayCertification.create(user_id: user.id, status: 1)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def set_autologin_cookie(user)
|
|
|
|
|
token = Token.get_or_create_permanent_login_token(user, "autologin")
|
|
|
|
|
cookie_options = {
|
|
|
|
|
:value => token.value,
|
|
|
|
|
:expires => 1.month.from_now,
|
|
|
|
|
:path => '/',
|
|
|
|
|
:secure => false,
|
|
|
|
|
:httponly => true
|
|
|
|
|
}
|
|
|
|
|
if edu_setting('cookie_domain').present?
|
|
|
|
|
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
|
|
|
|
|
end
|
|
|
|
|
cookies[autologin_cookie_name] = cookie_options
|
|
|
|
|
logger.info("cookies is #{cookies}")
|
|
|
|
|
end
|
|
|
|
|
# def set_autologin_cookie(user)
|
|
|
|
|
# token = Token.get_or_create_permanent_login_token(user, "autologin")
|
|
|
|
|
# cookie_options = {
|
|
|
|
|
# :value => token.value,
|
|
|
|
|
# :expires => 1.month.from_now,
|
|
|
|
|
# :path => '/',
|
|
|
|
|
# :secure => false,
|
|
|
|
|
# :httponly => true
|
|
|
|
|
# }
|
|
|
|
|
# if edu_setting('cookie_domain').present?
|
|
|
|
|
# cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
|
|
|
|
|
# end
|
|
|
|
|
# cookies[autologin_cookie_name] = cookie_options
|
|
|
|
|
# logger.info("cookies is #{cookies}")
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
def logout
|
|
|
|
|
UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip)
|
|
|
|
|