|
|
@ -207,6 +207,9 @@ class ApplicationController < ActionController::Base
|
|
|
|
elsif session[:wechat_openid]
|
|
|
|
elsif session[:wechat_openid]
|
|
|
|
uw = UserWechat.find_by_openid(session[:wechat_openid])
|
|
|
|
uw = UserWechat.find_by_openid(session[:wechat_openid])
|
|
|
|
user = uw.user if uw
|
|
|
|
user = uw.user if uw
|
|
|
|
|
|
|
|
elsif session[:third_party_user_id]
|
|
|
|
|
|
|
|
c_user = UserSource.find_by_id(session[:third_party_user_id])
|
|
|
|
|
|
|
|
user = c_user.user if c_user
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if user.nil? && Setting.rest_api_enabled? && accept_api_auth?
|
|
|
|
if user.nil? && Setting.rest_api_enabled? && accept_api_auth?
|
|
|
@ -300,6 +303,7 @@ class ApplicationController < ActionController::Base
|
|
|
|
end
|
|
|
|
end
|
|
|
|
# Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
|
|
|
|
# Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
|
|
|
|
self.logged_user = nil
|
|
|
|
self.logged_user = nil
|
|
|
|
|
|
|
|
session[:third_party_user_id] = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|