Skip to content

Commit

Permalink
change logout to a post request & update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzone committed Feb 26, 2016
1 parent a00418f commit bca602b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/routes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports.routes = {
'post /register': 'UserController.create',
'get /logout': 'AuthController.logout',
'post /logout': 'AuthController.logout',

'post /auth/local': 'AuthController.callback',
'post /auth/local/:action': 'AuthController.callback',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/controllers/UserController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('User Controller', function () {
var agent = request.agent(sails.hooks.http.app);

agent
.get('/logout')
.post('/logout')
.expect(302, function (err, res) {

if (err)
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('User Controller', function () {

it('should not find user if they have logged out', function (done) {

io.socket.get('/logout', function (data, jwres) {
io.socket.post('/logout', function (data, jwres) {

assert.equal(jwres.statusCode, 200);

Expand Down

1 comment on commit bca602b

@jamchen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, is this a security concern or just a design decision?

Please sign in to comment.