hapi-auth-cookie
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -68,3 +68,3 @@ 'use strict'; | ||
request.auth.session.set({ sid: sid }); | ||
request.cookieAuth.set({ sid: sid }); | ||
return reply.redirect('/'); | ||
@@ -76,3 +76,3 @@ }); | ||
request.auth.session.clear(); | ||
request.cookieAuth.clear(); | ||
return reply.redirect('/'); | ||
@@ -79,0 +79,0 @@ }; |
@@ -74,3 +74,3 @@ 'use strict'; | ||
request.auth.session = { | ||
request.cookieAuth = { | ||
set: function (session, value) { | ||
@@ -77,0 +77,0 @@ |
{ | ||
"name": "hapi-auth-cookie", | ||
"description": "Cookie authentication plugin", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"repository": "git://github.com/hapijs/hapi-auth-cookie", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -46,3 +46,3 @@ ### hapi-auth-cookie | ||
- `request` - is the Hapi request object of the request which is being authenticated. | ||
- `session` - is the session object set via `request.auth.session.set()`. | ||
- `session` - is the session object set via `request.cookieAuth.set()`. | ||
- `callback` - a callback function with the signature `function(err, isValid, credentials)` | ||
@@ -54,5 +54,5 @@ where: | ||
`request.auth.credentials`. If value is `null` or `undefined`, defaults to `session`. If | ||
set, will override the current cookie as if `request.auth.session.set()` was called. | ||
set, will override the current cookie as if `request.cookieAuth.set()` was called. | ||
When the cookie scheme is enabled on a route, the `request.auth.session` objects is decorated with | ||
When the cookie scheme is enabled on a route, the `request.cookieAuth` objects is decorated with | ||
the following methods: | ||
@@ -144,3 +144,3 @@ - `set(session)` - sets the current session. Must be called after a successful login to begin the | ||
request.auth.session.set({ sid: sid }); | ||
request.cookieAuth.set({ sid: sid }); | ||
return reply.redirect('/'); | ||
@@ -152,3 +152,3 @@ }); | ||
request.auth.session.clear(); | ||
request.cookieAuth.clear(); | ||
return reply.redirect('/'); | ||
@@ -155,0 +155,0 @@ }; |
@@ -143,3 +143,3 @@ 'use strict'; | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -228,3 +228,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -296,3 +296,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -306,3 +306,3 @@ } | ||
request.auth.session.clear(); | ||
request.cookieAuth.clear(); | ||
return reply('logged-out'); | ||
@@ -362,3 +362,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -425,3 +425,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -481,3 +481,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -541,3 +541,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -603,3 +603,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -648,3 +648,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -709,3 +709,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -767,3 +767,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -832,3 +832,3 @@ } | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -895,3 +895,3 @@ } | ||
try { | ||
request.auth.session.set(); | ||
request.cookieAuth.set(); | ||
} | ||
@@ -936,3 +936,3 @@ catch (error) { | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -946,3 +946,3 @@ } | ||
request.auth.session.set('key', 'value'); | ||
request.cookieAuth.set('key', 'value'); | ||
done(); | ||
@@ -993,3 +993,3 @@ } | ||
try { | ||
request.auth.session.set('key', 'value'); | ||
request.cookieAuth.set('key', 'value'); | ||
} | ||
@@ -1035,3 +1035,3 @@ catch (error) { | ||
try { | ||
request.auth.session.set({}, 'value'); | ||
request.cookieAuth.set({}, 'value'); | ||
} | ||
@@ -1077,3 +1077,3 @@ catch (error) { | ||
try { | ||
request.auth.session.set(null, 'value'); | ||
request.cookieAuth.set(null, 'value'); | ||
} | ||
@@ -1121,3 +1121,3 @@ catch (error) { | ||
request.auth.session.set({ user: request.params.user }); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
return reply(request.params.user); | ||
@@ -1131,3 +1131,3 @@ } | ||
request.auth.session.clear('key'); | ||
request.cookieAuth.clear('key'); | ||
done(); | ||
@@ -1178,3 +1178,3 @@ } | ||
try { | ||
request.auth.session.clear('key'); | ||
request.cookieAuth.clear('key'); | ||
} | ||
@@ -1220,3 +1220,3 @@ catch (error) { | ||
try { | ||
request.auth.session.clear({}); | ||
request.cookieAuth.clear({}); | ||
} | ||
@@ -1262,3 +1262,3 @@ catch (error) { | ||
try { | ||
request.auth.session.clear(null); | ||
request.cookieAuth.clear(null); | ||
} | ||
@@ -1306,4 +1306,4 @@ catch (error) { | ||
request.auth.session.set({ user: request.params.user }); | ||
request.auth.session.ttl(60 * 1000); | ||
request.cookieAuth.set({ user: request.params.user }); | ||
request.cookieAuth.ttl(60 * 1000); | ||
return reply(request.params.user); | ||
@@ -1317,3 +1317,3 @@ } | ||
request.auth.session.set('key', 'value'); | ||
request.cookieAuth.set('key', 'value'); | ||
done(); | ||
@@ -1320,0 +1320,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74142