Skip to content

Commit c8506bf

Browse files
committed
remove check for auth mode. closes hapijs/hapi#2843 - see discussion: #111
1 parent 18ebe00 commit c8506bf

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

lib/index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,7 @@ internals.implementation = function (server, options) {
2727
return {
2828
authenticate: function (request, reply) {
2929
var token = extract(request, options);
30-
31-
if (!token && request.auth.mode !== 'required') {
32-
// request.auth.isAuthenticated = false;
33-
console.log(' - - - - - - - - - - - - - - - - - - - > SHORT Circuit!')
34-
console.log(request.auth);
35-
console.log(' - - - - - - - - - - - - - - - - - - - - - - -')
36-
return reply.continue();
37-
}
38-
30+
3931
if (!token) {
4032
return reply(Boom.unauthorized(null, 'Token'));
4133
}

test/try-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ test('Auth mode \'try\' should not set isAuthenticated to true when no token sen
2424
method: 'GET',
2525
path: '/try',
2626
handler: function (request, reply) {
27-
console.log(' - - - - - - - - - - - - - - - - - - - - - - -')
28-
console.log(request.auth);
29-
console.log(' - - - - - - - - - - - - - - - - - - - - - - -')
27+
// console.log(' - - - - - - - - - - - - - - - - - - - - - - -')
28+
// console.log(request.auth);
29+
// console.log(' - - - - - - - - - - - - - - - - - - - - - - -')
3030
t.notOk(request.auth.isAuthenticated, 'isAuthenticated is false')
3131
reply('TRY');
3232
},

0 commit comments

Comments
 (0)