mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
add indentify option and uuid for users not logged in
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
AnalyticsManager = require "./AnalyticsManager"
|
||||
AuthenticationController = require("../Authentication/AuthenticationController")
|
||||
|
||||
module.exports = AnalyticsController =
|
||||
recordEvent: (req, res, next) ->
|
||||
AnalyticsManager.recordEvent req.session?.user?._id, req.params.event, req.body, (error) ->
|
||||
user_id = AuthenticationController.getLoggedInUserId(req) or req.sessionID
|
||||
AnalyticsManager.recordEvent user_id, req.params.event, req.body, (error) ->
|
||||
return next(error) if error?
|
||||
res.send 204
|
||||
|
||||
@@ -16,6 +16,14 @@ makeRequest = (opts, callback)->
|
||||
|
||||
module.exports =
|
||||
|
||||
idendifyUser: (user_id, old_user_id, callback)->
|
||||
opts =
|
||||
body:
|
||||
old_user_id:old_user_id
|
||||
json:true
|
||||
method:"POST"
|
||||
timeout:1000
|
||||
url: "/user/#{user_id}/idendify"
|
||||
|
||||
recordEvent: (user_id, event, segmentation = {}, callback = (error) ->) ->
|
||||
if user_id+"" == settings.smokeTest?.userId+""
|
||||
|
||||
@@ -9,6 +9,8 @@ module.exports =
|
||||
|
||||
webRouter.get '/tos', HomeController.externalPage("tos", "Terms of Service")
|
||||
webRouter.get '/about', HomeController.externalPage("about", "About Us")
|
||||
webRouter.get '/review', HomeController.externalPage("review", "About Us")
|
||||
|
||||
webRouter.get '/security', HomeController.externalPage("security", "Security")
|
||||
webRouter.get '/privacy_policy', HomeController.externalPage("privacy", "Privacy Policy")
|
||||
webRouter.get '/planned_maintenance', HomeController.externalPage("planned_maintenance", "Planned Maintenance")
|
||||
|
||||
Reference in New Issue
Block a user