aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/authentication/models/User.ts2
-rw-r--r--src/server/index.ts15
2 files changed, 16 insertions, 1 deletions
diff --git a/src/server/authentication/models/User.ts b/src/server/authentication/models/User.ts
index ed2952e48..bc838bb47 100644
--- a/src/server/authentication/models/User.ts
+++ b/src/server/authentication/models/User.ts
@@ -47,7 +47,7 @@ const userSchema = new mongoose.Schema({
passwordResetToken: String,
passwordResetExpires: Date,
- workspaces: Array,
+ userDocumentId: String,
facebook: String,
twitter: String,
diff --git a/src/server/index.ts b/src/server/index.ts
index 7189b32a0..87b6b0005 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -89,6 +89,21 @@ app.get("/home", (req, res) => {
res.sendFile(path.join(__dirname, '../../deploy/index.html'));
});
+app.get("/getUserDocId", (req, res) => {
+ console.log(req.user)
+ if (!req.user) {
+ return;
+ }
+ res.send(req.user.userDocumentId || "");
+})
+
+app.post("/setUserDocId", (req, res) => {
+ if (!req.user) {
+ return;
+ }
+ req.user.update({ $set: { userDocumentId: req.body.userDocumentId } }, () => { });
+})
+
// anyone attempting to navigate to localhost at this port will
// first have to login
app.get("/", getEntry);