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