diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/authentication/models/User.ts | 3 | ||||
| -rw-r--r-- | src/server/index.ts | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/server/authentication/models/User.ts b/src/server/authentication/models/User.ts index 9e6c525c3..30fcecd81 100644 --- a/src/server/authentication/models/User.ts +++ b/src/server/authentication/models/User.ts @@ -45,7 +45,8 @@ const userSchema = new mongoose.Schema({ password: String, passwordResetToken: String, passwordResetExpires: Date, - userDoc: String, + + userDocumentId: String, facebook: String, twitter: String, diff --git a/src/server/index.ts b/src/server/index.ts index 9480eaacb..e99e5f98a 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -87,6 +87,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); |
