@adonisjs/auth 10.0.0-next.5 → 10.0.0
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/{auth_manager-CJvMGOzX.js → auth_manager-hJTiBA2V.js} +1 -1
- package/build/{errors-Ns_FO2np.js → errors-sGy-K8pd.js} +2 -2
- package/build/index.js +3 -3
- package/build/modules/access_tokens_guard/main.js +10 -3
- package/build/modules/access_tokens_guard/token_providers/db.d.ts +10 -0
- package/build/modules/basic_auth_guard/main.js +2 -2
- package/build/modules/session_guard/main.js +2 -2
- package/build/providers/auth_provider.js +2 -2
- package/build/src/mixins/lucid.js +1 -1
- package/build/{symbols-BwcLqNln.js → symbols-BQLDWwuQ.js} +1 -1
- package/package.json +29 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as E_UNAUTHORIZED_ACCESS } from "./errors-
|
|
1
|
+
import { n as E_UNAUTHORIZED_ACCESS } from "./errors-sGy-K8pd.js";
|
|
2
2
|
import { t as debug_default } from "./debug-Ckko95-M.js";
|
|
3
3
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
4
4
|
import { HttpContextFactory } from "@adonisjs/core/factories/http";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { Exception } from "@adonisjs/core/exceptions";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __exportAll = (all,
|
|
4
|
+
var __exportAll = (all, no_symbols) => {
|
|
5
5
|
let target = {};
|
|
6
6
|
for (var name in all) __defProp(target, name, {
|
|
7
7
|
get: all[name],
|
|
8
8
|
enumerable: true
|
|
9
9
|
});
|
|
10
|
-
if (
|
|
10
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
11
|
return target;
|
|
12
12
|
};
|
|
13
13
|
var errors_exports = /* @__PURE__ */ __exportAll({
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as errors_exports } from "./errors-
|
|
2
|
-
import { t as symbols_exports } from "./symbols-
|
|
1
|
+
import { r as errors_exports } from "./errors-sGy-K8pd.js";
|
|
2
|
+
import { t as symbols_exports } from "./symbols-BQLDWwuQ.js";
|
|
3
3
|
import "./debug-Ckko95-M.js";
|
|
4
|
-
import { n as AuthenticatorClient, r as Authenticator, t as AuthManager } from "./auth_manager-
|
|
4
|
+
import { n as AuthenticatorClient, r as Authenticator, t as AuthManager } from "./auth_manager-hJTiBA2V.js";
|
|
5
5
|
import { presetAuth } from "@adonisjs/presets/auth";
|
|
6
6
|
import { configProvider } from "@adonisjs/core";
|
|
7
7
|
async function configure(command) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as E_UNAUTHORIZED_ACCESS } from "../../errors-
|
|
2
|
-
import "../../symbols-
|
|
1
|
+
import { n as E_UNAUTHORIZED_ACCESS } from "../../errors-sGy-K8pd.js";
|
|
2
|
+
import "../../symbols-BQLDWwuQ.js";
|
|
3
3
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
4
4
|
import { inspect } from "node:util";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
@@ -299,7 +299,7 @@ var CRC32 = class {
|
|
|
299
299
|
var AccessToken = class {
|
|
300
300
|
static decode(prefix, value) {
|
|
301
301
|
if (typeof value !== "string" || !value.startsWith(`${prefix}`)) return null;
|
|
302
|
-
const token = value.replace(
|
|
302
|
+
const token = value.replace(new RegExp(`^${prefix}`), "");
|
|
303
303
|
if (!token) return null;
|
|
304
304
|
const [identifier, ...tokenValue] = token.split(".");
|
|
305
305
|
if (!identifier || tokenValue.length === 0) return null;
|
|
@@ -557,6 +557,13 @@ var DbAccessTokensProvider = class DbAccessTokensProvider {
|
|
|
557
557
|
type: this.type
|
|
558
558
|
}).del().exec();
|
|
559
559
|
}
|
|
560
|
+
async deleteAll(user) {
|
|
561
|
+
this.#ensureIsPersisted(user);
|
|
562
|
+
return await (await this.getDb()).query().from(this.table).where({
|
|
563
|
+
tokenable_id: user.$primaryKeyValue,
|
|
564
|
+
type: this.type
|
|
565
|
+
}).del().exec();
|
|
566
|
+
}
|
|
560
567
|
async all(user) {
|
|
561
568
|
this.#ensureIsPersisted(user);
|
|
562
569
|
return (await (await this.getDb()).query().from(this.table).where({
|
|
@@ -136,6 +136,16 @@ export declare class DbAccessTokensProvider<TokenableModel extends LucidModel> i
|
|
|
136
136
|
* console.log('Deleted tokens:', deletedCount)
|
|
137
137
|
*/
|
|
138
138
|
delete(user: InstanceType<TokenableModel>, identifier: string | number | BigInt): Promise<number>;
|
|
139
|
+
/**
|
|
140
|
+
* Delete all tokens for a given user
|
|
141
|
+
*
|
|
142
|
+
* @param user - The user instance to delete tokens for
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* const deletedCount = await provider.deleteAll(user)
|
|
146
|
+
* console.log('Deleted tokens:', deletedCount)
|
|
147
|
+
*/
|
|
148
|
+
deleteAll(user: InstanceType<TokenableModel>): Promise<number>;
|
|
139
149
|
/**
|
|
140
150
|
* Returns all the tokens for a given user
|
|
141
151
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as E_UNAUTHORIZED_ACCESS } from "../../errors-
|
|
2
|
-
import "../../symbols-
|
|
1
|
+
import { n as E_UNAUTHORIZED_ACCESS } from "../../errors-sGy-K8pd.js";
|
|
2
|
+
import "../../symbols-BQLDWwuQ.js";
|
|
3
3
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
4
4
|
import { base64 } from "@adonisjs/core/helpers";
|
|
5
5
|
import auth from "basic-auth";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as E_UNAUTHORIZED_ACCESS } from "../../errors-
|
|
2
|
-
import "../../symbols-
|
|
1
|
+
import { n as E_UNAUTHORIZED_ACCESS } from "../../errors-sGy-K8pd.js";
|
|
2
|
+
import "../../symbols-BQLDWwuQ.js";
|
|
3
3
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
4
4
|
import { inspect } from "node:util";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../errors-
|
|
1
|
+
import "../errors-sGy-K8pd.js";
|
|
2
2
|
import "../debug-Ckko95-M.js";
|
|
3
|
-
import { t as AuthManager } from "../auth_manager-
|
|
3
|
+
import { t as AuthManager } from "../auth_manager-hJTiBA2V.js";
|
|
4
4
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
5
5
|
import { configProvider } from "@adonisjs/core";
|
|
6
6
|
var AuthProvider = class {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as E_INVALID_CREDENTIALS } from "../../errors-
|
|
1
|
+
import { t as E_INVALID_CREDENTIALS } from "../../errors-sGy-K8pd.js";
|
|
2
2
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
3
3
|
import { beforeSave } from "@adonisjs/lucid/orm";
|
|
4
4
|
function __decorate(decorators, target, key, desc) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/auth",
|
|
3
3
|
"description": "Official authentication provider for Adonis framework",
|
|
4
|
-
"version": "10.0.0
|
|
4
|
+
"version": "10.0.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"pretest": "npm run lint",
|
|
34
|
-
"test": "npm run test:mysql && npm run test:pg && npm run test:mssql &&
|
|
34
|
+
"test": "npm run test:mysql && npm run test:pg && npm run test:mssql && npm run test:sqlite",
|
|
35
35
|
"test:sqlite": "npm run quick:test",
|
|
36
36
|
"test:mysql": "cross-env DB=mysql npm run quick:test",
|
|
37
37
|
"test:mssql": "cross-env DB=mssql npm run quick:test",
|
|
@@ -51,64 +51,64 @@
|
|
|
51
51
|
"quick:test": "cross-env NODE_DEBUG=\"adonisjs:auth:*\" node --enable-source-maps --import=@poppinss/ts-exec ./bin/test.js"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@adonisjs/assembler": "^8.0.0
|
|
55
|
-
"@adonisjs/core": "^7.0.0
|
|
56
|
-
"@adonisjs/eslint-config": "^3.0.0
|
|
57
|
-
"@adonisjs/i18n": "^3.0.0
|
|
58
|
-
"@adonisjs/lucid": "^22.0.0
|
|
54
|
+
"@adonisjs/assembler": "^8.0.0",
|
|
55
|
+
"@adonisjs/core": "^7.0.0",
|
|
56
|
+
"@adonisjs/eslint-config": "^3.0.0",
|
|
57
|
+
"@adonisjs/i18n": "^3.0.0",
|
|
58
|
+
"@adonisjs/lucid": "^22.0.0",
|
|
59
59
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
60
|
-
"@adonisjs/session": "^8.0.0
|
|
61
|
-
"@adonisjs/tsconfig": "^2.0.0
|
|
60
|
+
"@adonisjs/session": "^8.0.0",
|
|
61
|
+
"@adonisjs/tsconfig": "^2.0.0",
|
|
62
62
|
"@japa/api-client": "^3.2.1",
|
|
63
63
|
"@japa/assert": "^4.2.0",
|
|
64
64
|
"@japa/browser-client": "^2.3.0",
|
|
65
65
|
"@japa/expect-type": "^2.0.4",
|
|
66
66
|
"@japa/file-system": "^3.0.0",
|
|
67
|
-
"@japa/plugin-adonisjs": "^5.1.0
|
|
67
|
+
"@japa/plugin-adonisjs": "^5.1.0",
|
|
68
68
|
"@japa/runner": "^5.3.0",
|
|
69
69
|
"@japa/snapshot": "^2.0.10",
|
|
70
|
-
"@poppinss/ts-exec": "^1.4.
|
|
71
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
70
|
+
"@poppinss/ts-exec": "^1.4.4",
|
|
71
|
+
"@release-it/conventional-changelog": "^10.0.5",
|
|
72
72
|
"@types/basic-auth": "^1.1.8",
|
|
73
73
|
"@types/luxon": "^3.7.1",
|
|
74
|
-
"@types/node": "^25.0
|
|
74
|
+
"@types/node": "^25.3.0",
|
|
75
75
|
"@types/set-cookie-parser": "^2.4.10",
|
|
76
76
|
"@types/sinon": "^21.0.0",
|
|
77
77
|
"better-sqlite3": "^12.6.2",
|
|
78
|
-
"c8": "^
|
|
78
|
+
"c8": "^11.0.0",
|
|
79
79
|
"convert-hrtime": "^5.0.0",
|
|
80
80
|
"copyfiles": "^2.4.1",
|
|
81
81
|
"cross-env": "^10.1.0",
|
|
82
82
|
"del-cli": "^7.0.0",
|
|
83
|
-
"dotenv": "^17.
|
|
84
|
-
"eslint": "^
|
|
83
|
+
"dotenv": "^17.3.1",
|
|
84
|
+
"eslint": "^10.0.2",
|
|
85
85
|
"luxon": "^3.7.2",
|
|
86
|
-
"mysql2": "^3.
|
|
87
|
-
"nock": "^14.0.
|
|
88
|
-
"pg": "^8.
|
|
89
|
-
"playwright": "^1.
|
|
86
|
+
"mysql2": "^3.18.0",
|
|
87
|
+
"nock": "^14.0.11",
|
|
88
|
+
"pg": "^8.18.0",
|
|
89
|
+
"playwright": "^1.58.2",
|
|
90
90
|
"prettier": "^3.8.1",
|
|
91
91
|
"release-it": "^19.2.4",
|
|
92
92
|
"set-cookie-parser": "^3.0.1",
|
|
93
93
|
"sinon": "^21.0.1",
|
|
94
|
-
"tedious": "^19.2.
|
|
94
|
+
"tedious": "^19.2.1",
|
|
95
95
|
"timekeeper": "^2.3.1",
|
|
96
|
-
"tsdown": "^0.
|
|
96
|
+
"tsdown": "^0.20.3",
|
|
97
97
|
"typescript": "^5.9.3"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@adonisjs/presets": "^3.0.0
|
|
100
|
+
"@adonisjs/presets": "^3.0.0",
|
|
101
101
|
"basic-auth": "^2.0.1"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@adonisjs/assembler": "^8.0.0-next.26",
|
|
105
|
-
"@adonisjs/core": "^7.0.0-next.16",
|
|
106
|
-
"@adonisjs/i18n": "^3.0.0-next.2",
|
|
107
|
-
"@adonisjs/lucid": "^22.0.0-next.1",
|
|
108
|
-
"@adonisjs/session": "^8.0.0-next.1",
|
|
104
|
+
"@adonisjs/assembler": "^8.0.0-next.26 || ^8.0.0",
|
|
105
|
+
"@adonisjs/core": "^7.0.0-next.16 || ^7.0.0",
|
|
106
|
+
"@adonisjs/i18n": "^3.0.0-next.2 || ^3.0.0",
|
|
107
|
+
"@adonisjs/lucid": "^22.0.0-next.1 || ^22.0.0",
|
|
108
|
+
"@adonisjs/session": "^8.0.0-next.1 || ^8.0.0",
|
|
109
109
|
"@japa/api-client": "^3.1.1",
|
|
110
110
|
"@japa/browser-client": "^2.2.0",
|
|
111
|
-
"@japa/plugin-adonisjs": "^5.1.0-next.0"
|
|
111
|
+
"@japa/plugin-adonisjs": "^5.1.0-next.0 || ^5.1.0"
|
|
112
112
|
},
|
|
113
113
|
"peerDependenciesMeta": {
|
|
114
114
|
"@adonisjs/assembler": {
|