dev_oauth
p31729568 5 years ago
parent fe860fd2a1
commit 11b107987e

@ -291,10 +291,6 @@ class ApplicationController < ActionController::Base
end
end
def autologin_cookie_name
edu_setting('autologin_cookie_name').presence || 'autologin'
end
def try_to_autologin
if cookies[autologin_cookie_name]
# auto-login feature starts a new session
@ -605,22 +601,6 @@ class ApplicationController < ActionController::Base
cookies[:fileDownload] = true
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
# 149课程的评审用户数据创建包含创建课堂学生
def open_class_user
user = User.find_by(login: "OpenClassUser")

@ -6,7 +6,7 @@ module LoginHelper
end
def autologin_cookie_name
edu_setting('autologin_cookie_name') || 'autologin'
edu_setting('autologin_cookie_name').presence || 'autologin'
end
def set_autologin_cookie(user)

Loading…
Cancel
Save