@maximemrf/adonisjs-jwt 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/jwt.js +4 -2
- package/package.json +1 -1
package/build/src/jwt.js
CHANGED
|
@@ -64,12 +64,14 @@ export class JwtGuard {
|
|
|
64
64
|
this.authenticationAttempted = true;
|
|
65
65
|
const cookieHeader = this.#ctx.request.request.headers.cookie;
|
|
66
66
|
let token;
|
|
67
|
+
console.log('cookieHeader', cookieHeader);
|
|
67
68
|
/**
|
|
68
69
|
* If cookies are enabled, then read the token from the cookies
|
|
69
70
|
*/
|
|
70
71
|
if (cookieHeader) {
|
|
71
|
-
;
|
|
72
|
-
|
|
72
|
+
token = (this.#ctx.request.request.headers.cookie.match(/token=(.*?)(;|$)/) || [])[1];
|
|
73
|
+
console.log('cookietoken|', token);
|
|
74
|
+
//;[, token] = cookieHeader!.split('=')
|
|
73
75
|
}
|
|
74
76
|
/**
|
|
75
77
|
* If token is missing on cookies, then try to read it from the header authorization
|