Skip to content

Commit 9095f98

Browse files
committed
Removed extra /logout handler
1 parent b6a67e2 commit 9095f98

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

sessions.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,6 @@ function handleGet(req) {
4141
});
4242
}
4343

44-
function handleLogout(req) {
45-
// TODO: Verify correct behavior for logout without token
46-
if (!req.info || !req.info.sessionToken) {
47-
throw new Parse.Error(Parse.Error.SESSION_MISSING,
48-
'Session token required for logout.');
49-
}
50-
return rest.find(req.config, Auth.master(req.config), '_Session',
51-
{ _session_token: req.info.sessionToken})
52-
.then((response) => {
53-
if (!response.results || response.results.length == 0) {
54-
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN,
55-
'Session token not found.');
56-
}
57-
return rest.del(req.config, Auth.master(req.config), '_Session',
58-
response.results[0].objectId);
59-
}).then(() => {
60-
return {
61-
status: 200,
62-
response: {}
63-
};
64-
});
65-
}
66-
6744
function handleFind(req) {
6845
var options = {};
6946
if (req.body.skip) {
@@ -111,12 +88,11 @@ function handleMe(req) {
11188
});
11289
}
11390

114-
router.route('POST', '/logout', handleLogout);
11591
router.route('POST','/sessions', handleCreate);
11692
router.route('GET','/sessions/me', handleMe);
11793
router.route('GET','/sessions/:objectId', handleGet);
11894
router.route('PUT','/sessions/:objectId', handleUpdate);
11995
router.route('GET','/sessions', handleFind);
12096
router.route('DELETE','/sessions/:objectId', handleDelete);
12197

122-
module.exports = router;
98+
module.exports = router;

0 commit comments

Comments
 (0)