set token
This commit is contained in:
9
index.js
9
index.js
@@ -200,6 +200,15 @@ DB.getDB.then((DB)=>{
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/token/', sessionChecker, async (req, res) => {
|
||||
const profileid = getProfileId(req);
|
||||
let token = await DB.getProfile(req.body.token);
|
||||
DB.setProfileToken(profileid, token);
|
||||
return res.json({
|
||||
status: "ok"
|
||||
});
|
||||
});
|
||||
|
||||
// route for user logout
|
||||
const logout = function(req, res){
|
||||
const session_id = getSessionId(req);
|
||||
|
||||
Reference in New Issue
Block a user