@lobb-js/lobb-ext-auth 0.12.0 → 0.13.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/dist/lib/components/pages/loginPage/index.svelte +1 -1
- package/dist/lib/components/pages/settings/pages/activityFeed.svelte +1 -1
- package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte +1 -1
- package/dist/lib/components/pages/settings/pages/users.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/loginPage/index.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/settings/pages/activityFeed.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/settings/pages/rolesAndPermissions.svelte +1 -1
- package/extensions/auth/studio/lib/components/pages/settings/pages/users.svelte +1 -1
- package/package.json +5 -5
- package/extensions/auth/tests/collections/extend_users_collection.test.ts +0 -61
- package/extensions/auth/tests/collections/shares.test.ts +0 -657
- package/extensions/auth/tests/configs/auth.ts +0 -101
- package/extensions/auth/tests/configs/auth_no_roles.ts +0 -65
- package/extensions/auth/tests/configs/auth_public_full_access.ts +0 -69
- package/extensions/auth/tests/configs/auth_with_admin_extra_fields.ts +0 -53
- package/extensions/auth/tests/configs/auth_with_different_admin_creds.ts +0 -81
- package/extensions/auth/tests/configs/auth_with_extend_users.ts +0 -79
- package/extensions/auth/tests/configs/auth_with_refresh_token.ts +0 -86
- package/extensions/auth/tests/configs/auth_with_short_access_token_only.ts +0 -95
- package/extensions/auth/tests/configs/auth_with_short_time_refresh_token.ts +0 -86
- package/extensions/auth/tests/configs/social_blog.ts +0 -146
- package/extensions/auth/tests/controllers/change_password.test.ts +0 -113
- package/extensions/auth/tests/controllers/dashboardAccessRoles.test.ts +0 -29
- package/extensions/auth/tests/controllers/login.test.ts +0 -101
- package/extensions/auth/tests/controllers/logout.test.ts +0 -89
- package/extensions/auth/tests/controllers/me.test.ts +0 -376
- package/extensions/auth/tests/controllers/register.test.ts +0 -45
- package/extensions/auth/tests/database/adminExtraFields.test.ts +0 -50
- package/extensions/auth/tests/database/db.test.ts +0 -64
- package/extensions/auth/tests/database/differentAdminCreds.test.ts +0 -51
- package/extensions/auth/tests/middlewares/adminAuthGuard.test.ts +0 -157
- package/extensions/auth/tests/middlewares/adminProtection.test.ts +0 -59
- package/extensions/auth/tests/middlewares/publicAllowBasic.test.ts +0 -137
- package/extensions/auth/tests/middlewares/publicPreventBasic.test.ts +0 -108
- package/extensions/auth/tests/permissions.test.ts +0 -127
- package/extensions/auth/tests/socialBlog.test.ts +0 -253
- package/extensions/auth/tests/utils/addArticles.ts +0 -22
- package/extensions/auth/tests/utils/addSocialBlogArticles.ts +0 -52
- package/extensions/auth/tests/utils/data/articles.ts +0 -65
- package/extensions/auth/tests/utils/data/socialBlogArticles.ts +0 -56
- package/extensions/auth/tests/workflows/shareIntersection.test.ts +0 -158
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<components.Separator />
|
|
16
|
-
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted
|
|
16
|
+
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted">
|
|
17
17
|
<components.DataTable
|
|
18
18
|
collectionName="auth_activity_feed"
|
|
19
19
|
/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<components.Separator />
|
|
16
|
-
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted
|
|
16
|
+
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted">
|
|
17
17
|
<components.DataTable
|
|
18
18
|
collectionName="auth_roles"
|
|
19
19
|
/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<components.Separator />
|
|
16
|
-
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted
|
|
16
|
+
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted">
|
|
17
17
|
<components.DataTable
|
|
18
18
|
collectionName="auth_users"
|
|
19
19
|
/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<components.Separator />
|
|
16
|
-
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted
|
|
16
|
+
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted">
|
|
17
17
|
<components.DataTable
|
|
18
18
|
collectionName="auth_activity_feed"
|
|
19
19
|
/>
|
package/extensions/auth/studio/lib/components/pages/settings/pages/rolesAndPermissions.svelte
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<components.Separator />
|
|
16
|
-
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted
|
|
16
|
+
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted">
|
|
17
17
|
<components.DataTable
|
|
18
18
|
collectionName="auth_roles"
|
|
19
19
|
/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<components.Separator />
|
|
16
|
-
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted
|
|
16
|
+
<div class="flex gap-4 border rounded-md overflow-hidden h-full bg-muted">
|
|
17
17
|
<components.DataTable
|
|
18
18
|
collectionName="auth_users"
|
|
19
19
|
/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobb-js/lobb-ext-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"test": "bun test
|
|
22
|
-
"test:lobb": "bun test
|
|
21
|
+
"test": "bun test tests",
|
|
22
|
+
"test:lobb": "bun test tests",
|
|
23
23
|
"dev": "bun run --watch lobb.ts",
|
|
24
24
|
"dev:studio": "vite dev",
|
|
25
25
|
"build": "vite build",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"package": "svelte-package --input extensions/auth/studio"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@lobb-js/core": "^0.
|
|
35
|
+
"@lobb-js/core": "^0.40.0",
|
|
36
36
|
"argon2": "^0.40.3",
|
|
37
37
|
"hono": "^4.7.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@lobb-js/studio": "^0.
|
|
40
|
+
"@lobb-js/studio": "^0.47.0",
|
|
41
41
|
"@lucide/svelte": "^0.563.1",
|
|
42
42
|
"@sveltejs/adapter-node": "^5.5.4",
|
|
43
43
|
"@sveltejs/kit": "^2.60.1",
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Lobb } from "@lobb-js/core";
|
|
2
|
-
import { afterAll, beforeAll, describe, it, expect } from "bun:test";
|
|
3
|
-
import { authWithExtendUsersConfig } from "../configs/auth_with_extend_users.ts";
|
|
4
|
-
|
|
5
|
-
describe("extend users collection", () => {
|
|
6
|
-
let lobb: Lobb;
|
|
7
|
-
let baseUrl: string;
|
|
8
|
-
|
|
9
|
-
beforeAll(async () => {
|
|
10
|
-
lobb = await Lobb.init(authWithExtendUsersConfig);
|
|
11
|
-
baseUrl = `http://127.0.0.1:${lobb.webServer.port}`;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
afterAll(async () => {
|
|
15
|
-
await lobb.collectionService.deleteMany({
|
|
16
|
-
collectionName: "auth_users",
|
|
17
|
-
filter: {},
|
|
18
|
-
force: true,
|
|
19
|
-
});
|
|
20
|
-
await lobb.close();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("should return a result with all the additional fields that exists in the (extend_users)", async () => {
|
|
24
|
-
const response = await fetch(
|
|
25
|
-
`${baseUrl}/api/collections/auth_users`,
|
|
26
|
-
{
|
|
27
|
-
method: "POST",
|
|
28
|
-
body: JSON.stringify({
|
|
29
|
-
data: {
|
|
30
|
-
email: "test@test.com",
|
|
31
|
-
password: "test",
|
|
32
|
-
role: "admin",
|
|
33
|
-
name: "test",
|
|
34
|
-
bio: "test",
|
|
35
|
-
language: "ar",
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
await response.json();
|
|
41
|
-
|
|
42
|
-
const response2 = await fetch(
|
|
43
|
-
`${baseUrl}/api/collections/auth_users?sort=id`,
|
|
44
|
-
{
|
|
45
|
-
method: "GET",
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
const result2 = await response2.json();
|
|
49
|
-
|
|
50
|
-
expect(response2.status).toEqual(200);
|
|
51
|
-
expect(
|
|
52
|
-
result2.data[1],
|
|
53
|
-
).toMatchObject({
|
|
54
|
-
role: "admin",
|
|
55
|
-
email: "test@test.com",
|
|
56
|
-
name: "test",
|
|
57
|
-
bio: "test",
|
|
58
|
-
language: "ar",
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
});
|