@adonisjs/auth 8.2.1 → 8.2.3
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/adonis-typings/auth.d.ts +1 -1
- package/build/instructions.js +2 -2
- package/build/src/UserProviders/Lucid/User.js +1 -1
- package/build/templates/config/auth.txt +1 -1
- package/build/templates/contract/partials/api-guard.txt +1 -0
- package/build/templates/contract/partials/basic-guard.txt +1 -0
- package/build/templates/contract/partials/web-guard.txt +1 -0
- package/build/templates/middleware/Auth.txt +2 -2
- package/build/templates/middleware/SilentAuth.txt +1 -1
- package/build/templates/migrations/api_tokens.txt +1 -1
- package/build/templates/migrations/auth.txt +2 -2
- package/build/templates/model.txt +1 -1
- package/package.json +29 -29
|
@@ -141,7 +141,7 @@ declare module '@ioc:Adonis/Addons/Auth' {
|
|
|
141
141
|
findForAuth?: <T extends LucidModel>(this: T, uids: string[], value: any) => Promise<InstanceType<T>>;
|
|
142
142
|
} & {
|
|
143
143
|
new (): LucidRow & {
|
|
144
|
-
password?: string;
|
|
144
|
+
password?: string | null;
|
|
145
145
|
rememberMeToken?: string | null;
|
|
146
146
|
};
|
|
147
147
|
};
|
package/build/instructions.js
CHANGED
|
@@ -278,9 +278,9 @@ async function instructions(projectRoot, app, sink) {
|
|
|
278
278
|
*/
|
|
279
279
|
if (state.provider === 'lucid') {
|
|
280
280
|
const modelName = await getModelName(sink);
|
|
281
|
-
state.modelName = modelName.replace(/(\.ts|\.js)$/, '');
|
|
281
|
+
state.modelName = helpers_1.string.pascalCase(helpers_1.string.singularize(modelName.replace(/(\.ts|\.js)$/, '')));
|
|
282
282
|
state.usersTableName = helpers_1.string.pluralize(helpers_1.string.snakeCase(state.modelName));
|
|
283
|
-
state.modelReference = helpers_1.string.camelCase(state.modelName);
|
|
283
|
+
state.modelReference = helpers_1.string.camelCase(helpers_1.string.singularize(state.modelName));
|
|
284
284
|
state.modelNamespace = `${app.namespacesMap.get('models') || 'App/Models'}/${state.modelName}`;
|
|
285
285
|
}
|
|
286
286
|
else {
|
|
@@ -69,6 +69,6 @@ let LucidUser = class LucidUser {
|
|
|
69
69
|
};
|
|
70
70
|
LucidUser = __decorate([
|
|
71
71
|
(0, standalone_1.inject)([null, null, 'Adonis/Core/Hash']),
|
|
72
|
-
__metadata("design:paramtypes", [
|
|
72
|
+
__metadata("design:paramtypes", [void 0, Object, Object])
|
|
73
73
|
], LucidUser);
|
|
74
74
|
exports.LucidUser = LucidUser;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GuardsList } from '@ioc:Adonis/Addons/Auth'
|
|
2
|
-
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
3
1
|
import { AuthenticationException } from '@adonisjs/auth/build/standalone'
|
|
2
|
+
import type { GuardsList } from '@ioc:Adonis/Addons/Auth'
|
|
3
|
+
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Auth middleware is meant to restrict un-authenticated access to a given route
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
2
2
|
|
|
3
|
-
export default class
|
|
3
|
+
export default class extends BaseSchema {
|
|
4
4
|
protected tableName = '{{ usersTableName }}'
|
|
5
5
|
|
|
6
6
|
public async up() {
|
|
7
7
|
this.schema.createTable(this.tableName, (table) => {
|
|
8
8
|
table.increments('id').primary()
|
|
9
|
-
table.string('email', 255).notNullable()
|
|
9
|
+
table.string('email', 255).notNullable().unique()
|
|
10
10
|
table.string('password', 180).notNullable()
|
|
11
11
|
table.string('remember_me_token').nullable()
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/auth",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "Official authentication provider for Adonis framework",
|
|
5
5
|
"types": "build/adonis-typings/index.d.ts",
|
|
6
6
|
"main": "build/providers/AuthProvider.js",
|
|
@@ -46,42 +46,42 @@
|
|
|
46
46
|
"url": "https://github.com/adonisjs/auth/issues"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@adonisjs/core": "^5.8.
|
|
50
|
-
"@adonisjs/i18n": "^1.5.
|
|
51
|
-
"@adonisjs/lucid": "^18.
|
|
49
|
+
"@adonisjs/core": "^5.8.8",
|
|
50
|
+
"@adonisjs/i18n": "^1.5.6",
|
|
51
|
+
"@adonisjs/lucid": "^18.2.0",
|
|
52
52
|
"@adonisjs/mrm-preset": "^5.0.3",
|
|
53
|
-
"@adonisjs/redis": "^7.3.
|
|
54
|
-
"@adonisjs/repl": "^3.1.
|
|
55
|
-
"@adonisjs/require-ts": "^2.0.
|
|
53
|
+
"@adonisjs/redis": "^7.3.1",
|
|
54
|
+
"@adonisjs/repl": "^3.1.11",
|
|
55
|
+
"@adonisjs/require-ts": "^2.0.13",
|
|
56
56
|
"@adonisjs/session": "^6.4.0",
|
|
57
|
-
"@adonisjs/sink": "^5.
|
|
58
|
-
"@japa/assert": "^1.3.
|
|
59
|
-
"@japa/preset-adonis": "^1.0
|
|
60
|
-
"@japa/run-failed-tests": "^1.0
|
|
61
|
-
"@japa/runner": "^2.
|
|
62
|
-
"@japa/spec-reporter": "^1.
|
|
57
|
+
"@adonisjs/sink": "^5.4.1",
|
|
58
|
+
"@japa/assert": "^1.3.6",
|
|
59
|
+
"@japa/preset-adonis": "^1.2.0",
|
|
60
|
+
"@japa/run-failed-tests": "^1.1.0",
|
|
61
|
+
"@japa/runner": "^2.2.2",
|
|
62
|
+
"@japa/spec-reporter": "^1.3.2",
|
|
63
63
|
"@poppinss/dev-utils": "^2.0.3",
|
|
64
|
-
"@types/node": "^
|
|
64
|
+
"@types/node": "^18.11.2",
|
|
65
65
|
"@types/supertest": "^2.0.12",
|
|
66
66
|
"copyfiles": "^2.4.1",
|
|
67
|
-
"del-cli": "^
|
|
68
|
-
"eslint": "^8.
|
|
67
|
+
"del-cli": "^5.0.0",
|
|
68
|
+
"eslint": "^8.25.0",
|
|
69
69
|
"eslint-config-prettier": "^8.5.0",
|
|
70
|
-
"eslint-plugin-adonis": "^2.1.
|
|
71
|
-
"eslint-plugin-prettier": "^4.
|
|
70
|
+
"eslint-plugin-adonis": "^2.1.1",
|
|
71
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
72
72
|
"github-label-sync": "^2.2.0",
|
|
73
73
|
"husky": "^8.0.1",
|
|
74
|
-
"mrm": "^4.
|
|
75
|
-
"np": "^7.6.
|
|
74
|
+
"mrm": "^4.1.13",
|
|
75
|
+
"np": "^7.6.2",
|
|
76
76
|
"phc-bcrypt": "^1.0.7",
|
|
77
|
-
"pino-pretty": "^
|
|
78
|
-
"prettier": "^2.
|
|
77
|
+
"pino-pretty": "^9.1.1",
|
|
78
|
+
"prettier": "^2.7.1",
|
|
79
79
|
"reflect-metadata": "^0.1.13",
|
|
80
|
-
"set-cookie-parser": "^2.
|
|
81
|
-
"sqlite3": "^5.
|
|
82
|
-
"supertest": "^6.
|
|
83
|
-
"ts-essentials": "^9.
|
|
84
|
-
"typescript": "^4.
|
|
80
|
+
"set-cookie-parser": "^2.5.1",
|
|
81
|
+
"sqlite3": "^5.1.2",
|
|
82
|
+
"supertest": "^6.3.0",
|
|
83
|
+
"ts-essentials": "^9.3.0",
|
|
84
|
+
"typescript": "^4.8.4"
|
|
85
85
|
},
|
|
86
86
|
"nyc": {
|
|
87
87
|
"exclude": [
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@poppinss/hooks": "^5.0.3",
|
|
105
|
-
"@poppinss/utils": "^
|
|
106
|
-
"luxon": "^
|
|
105
|
+
"@poppinss/utils": "^5.0.0",
|
|
106
|
+
"luxon": "^3.0.4"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@adonisjs/core": "^5.7.1",
|