@lobb-js/lobb-ext-auth 0.11.3 → 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.
Files changed (43) hide show
  1. package/dist/lib/components/pages/loginPage/index.svelte +1 -1
  2. package/dist/lib/components/pages/settings/pages/activityFeed.svelte +1 -1
  3. package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte +1 -1
  4. package/dist/lib/components/pages/settings/pages/users.svelte +1 -1
  5. package/dist/lib/components/pages/userSettings/index.svelte +1 -1
  6. package/extensions/auth/studio/lib/components/pages/loginPage/index.svelte +1 -1
  7. package/extensions/auth/studio/lib/components/pages/settings/pages/activityFeed.svelte +1 -1
  8. package/extensions/auth/studio/lib/components/pages/settings/pages/rolesAndPermissions.svelte +1 -1
  9. package/extensions/auth/studio/lib/components/pages/settings/pages/users.svelte +1 -1
  10. package/extensions/auth/studio/lib/components/pages/userSettings/index.svelte +1 -1
  11. package/package.json +5 -5
  12. package/extensions/auth/tests/collections/extend_users_collection.test.ts +0 -61
  13. package/extensions/auth/tests/collections/shares.test.ts +0 -657
  14. package/extensions/auth/tests/configs/auth.ts +0 -101
  15. package/extensions/auth/tests/configs/auth_no_roles.ts +0 -65
  16. package/extensions/auth/tests/configs/auth_public_full_access.ts +0 -69
  17. package/extensions/auth/tests/configs/auth_with_admin_extra_fields.ts +0 -53
  18. package/extensions/auth/tests/configs/auth_with_different_admin_creds.ts +0 -81
  19. package/extensions/auth/tests/configs/auth_with_extend_users.ts +0 -79
  20. package/extensions/auth/tests/configs/auth_with_refresh_token.ts +0 -86
  21. package/extensions/auth/tests/configs/auth_with_short_access_token_only.ts +0 -95
  22. package/extensions/auth/tests/configs/auth_with_short_time_refresh_token.ts +0 -86
  23. package/extensions/auth/tests/configs/social_blog.ts +0 -146
  24. package/extensions/auth/tests/controllers/change_password.test.ts +0 -113
  25. package/extensions/auth/tests/controllers/dashboardAccessRoles.test.ts +0 -29
  26. package/extensions/auth/tests/controllers/login.test.ts +0 -101
  27. package/extensions/auth/tests/controllers/logout.test.ts +0 -89
  28. package/extensions/auth/tests/controllers/me.test.ts +0 -376
  29. package/extensions/auth/tests/controllers/register.test.ts +0 -45
  30. package/extensions/auth/tests/database/adminExtraFields.test.ts +0 -50
  31. package/extensions/auth/tests/database/db.test.ts +0 -64
  32. package/extensions/auth/tests/database/differentAdminCreds.test.ts +0 -51
  33. package/extensions/auth/tests/middlewares/adminAuthGuard.test.ts +0 -157
  34. package/extensions/auth/tests/middlewares/adminProtection.test.ts +0 -59
  35. package/extensions/auth/tests/middlewares/publicAllowBasic.test.ts +0 -137
  36. package/extensions/auth/tests/middlewares/publicPreventBasic.test.ts +0 -108
  37. package/extensions/auth/tests/permissions.test.ts +0 -127
  38. package/extensions/auth/tests/socialBlog.test.ts +0 -253
  39. package/extensions/auth/tests/utils/addArticles.ts +0 -22
  40. package/extensions/auth/tests/utils/addSocialBlogArticles.ts +0 -52
  41. package/extensions/auth/tests/utils/data/articles.ts +0 -65
  42. package/extensions/auth/tests/utils/data/socialBlogArticles.ts +0 -56
  43. package/extensions/auth/tests/workflows/shareIntersection.test.ts +0 -158
@@ -33,7 +33,7 @@
33
33
  <div>Sign in to your account</div>
34
34
  </div>
35
35
  <form
36
- class="flex flex-col gap-6 rounded-md border bg-white p-6"
36
+ class="flex flex-col gap-6 rounded-md border bg-card p-6"
37
37
  onsubmit={handleOnSubmit}
38
38
  >
39
39
  <div class="flex flex-col gap-2">
@@ -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-soft">
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-soft">
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-soft">
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
  />
@@ -19,7 +19,7 @@
19
19
  });
20
20
 
21
21
  async function handleSave() {
22
- const response = await utils.lobb.updateOne("auth_users", "me", entry);
22
+ const response = await utils.lobb.updateOne("auth_users", "me", { data: entry });
23
23
  if (response.status >= 400) {
24
24
  const result = await response.json();
25
25
  utils.toast.error(result.message);
@@ -33,7 +33,7 @@
33
33
  <div>Sign in to your account</div>
34
34
  </div>
35
35
  <form
36
- class="flex flex-col gap-6 rounded-md border bg-white p-6"
36
+ class="flex flex-col gap-6 rounded-md border bg-card p-6"
37
37
  onsubmit={handleOnSubmit}
38
38
  >
39
39
  <div class="flex flex-col gap-2">
@@ -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-soft">
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-soft">
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-soft">
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
  />
@@ -19,7 +19,7 @@
19
19
  });
20
20
 
21
21
  async function handleSave() {
22
- const response = await utils.lobb.updateOne("auth_users", "me", entry);
22
+ const response = await utils.lobb.updateOne("auth_users", "me", { data: entry });
23
23
  if (response.status >= 400) {
24
24
  const result = await response.json();
25
25
  utils.toast.error(result.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobb-js/lobb-ext-auth",
3
- "version": "0.11.3",
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 extensions/auth/tests",
22
- "test:lobb": "bun test extensions/auth/tests",
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.33.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.31.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
- });