@maximemrf/adonisjs-jwt 0.0.15 → 0.0.17

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.
Files changed (2) hide show
  1. package/build/src/jwt.js +12 -1
  2. package/package.json +1 -1
package/build/src/jwt.js CHANGED
@@ -64,6 +64,7 @@ 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
  */
@@ -89,6 +90,7 @@ export class JwtGuard {
89
90
  */
90
91
  ;
91
92
  [, token] = authHeader.split('Bearer ');
93
+ console.log('token', token);
92
94
  if (!token) {
93
95
  throw new errors.E_UNAUTHORIZED_ACCESS('Unauthorized access', {
94
96
  guardDriverName: this.driverName,
@@ -154,9 +156,18 @@ export class JwtGuard {
154
156
  */
155
157
  async authenticateAsClient(user) {
156
158
  const token = await this.generate(user);
159
+ // if (this.#options.useCookies) {
160
+ // console.log('useCookies')
161
+ // console.log(token.ctx.response.cookie())
162
+ // return {
163
+ // headers: {
164
+ // 'set-cookie': `token=${token}`,
165
+ // },
166
+ // }
167
+ // }
157
168
  return {
158
169
  headers: {
159
- authorization: `Bearer ${this.#options.useCookies ? token : token.token}`,
170
+ authorization: `Bearer ${token.token}`,
160
171
  },
161
172
  };
162
173
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maximemrf/adonisjs-jwt",
3
3
  "description": "",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "engines": {
6
6
  "node": ">=20.6.0"
7
7
  },