Add /me* route which redirects to /user/[userslug]* (#6063)

* Add `/me*` route which redirects to the current user's information

- `/me` -> `/user/[usertslug]`
- `/me/bookmarks` -> `/user/[userslug]/bookmarks`
- `/me/settings` -> `/user/[userslug]/settings`

etc

* Add tests for `/me/*`
This commit is contained in:
Peter Jaszkowiak
2017-11-16 15:38:26 -07:00
committed by Barış Soner Uşaklı
parent 643008041c
commit f5385e38bf
4 changed files with 49 additions and 2 deletions

View File

@@ -186,8 +186,9 @@ describe('authentication', function () {
url: nconf.get('url') + '/api/me',
json: true,
jar: jar,
}, function (err, response, body) {
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 401);
assert.equal(body, 'not-authorized');
done();
});