@absolutejs/auth 0.22.5 → 0.22.6

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 (69) hide show
  1. package/dist/example/components/auth/AuthContainer.d.ts +1 -0
  2. package/dist/example/components/auth/OAuthButton.d.ts +7 -0
  3. package/dist/example/components/auth/OAuthButtons.d.ts +5 -0
  4. package/dist/example/components/hamburger/HamburgerDropdown.d.ts +10 -0
  5. package/dist/example/components/hamburger/HamburgerHeader.d.ts +5 -0
  6. package/dist/example/components/hamburger/HamburgerMenu.d.ts +14 -0
  7. package/dist/example/components/hamburger/HamburgerUserButtons.d.ts +8 -0
  8. package/dist/example/components/navbar/DropdownContainer.d.ts +17 -0
  9. package/dist/example/components/navbar/Navbar.d.ts +7 -0
  10. package/dist/example/components/navbar/NavbarDropdown.d.ts +10 -0
  11. package/dist/example/components/navbar/NavbarLink.d.ts +8 -0
  12. package/dist/example/components/navbar/NavbarLinks.d.ts +6 -0
  13. package/dist/example/components/navbar/NavbarUserButtons.d.ts +7 -0
  14. package/dist/example/components/page/Head.d.ts +6 -0
  15. package/dist/example/components/protected/AccountOverview.d.ts +6 -0
  16. package/dist/example/components/protected/DeleteAccountSection.d.ts +5 -0
  17. package/dist/example/components/protected/LinkedAuthIdentitiesPanel.d.ts +1 -0
  18. package/dist/example/components/protected/LinkedProvidersPanel.d.ts +1 -0
  19. package/dist/example/components/protected/ProviderButtons.d.ts +1 -0
  20. package/dist/example/components/protected/SettingsNoticeToast.d.ts +1 -0
  21. package/dist/example/components/protected/UserInfo.d.ts +7 -0
  22. package/dist/example/components/utils/AnimatedComponents.d.ts +1 -0
  23. package/dist/example/components/utils/Divider.d.ts +7 -0
  24. package/dist/example/components/utils/HighlightedJson.d.ts +5 -0
  25. package/dist/example/components/utils/JsonLine.d.ts +6 -0
  26. package/dist/example/components/utils/Modal.d.ts +9 -0
  27. package/dist/example/components/utils/ProfilePicture.d.ts +8 -0
  28. package/dist/example/components/utils/ProviderDropdown.d.ts +8 -0
  29. package/dist/example/components/utils/Toast.d.ts +14 -0
  30. package/dist/example/components/utils/ToastProvider.d.ts +30 -0
  31. package/dist/example/db/schema.d.ts +2570 -0
  32. package/dist/example/eden/treaty.d.ts +1 -0
  33. package/dist/example/handlers/userHandlers.d.ts +254 -0
  34. package/dist/example/hooks/useAuthIdentityPayload.d.ts +37 -0
  35. package/dist/example/hooks/useAuthStatus.d.ts +19 -0
  36. package/dist/example/hooks/useContainerQuery.d.ts +10 -0
  37. package/dist/example/hooks/useMediaQuery.d.ts +11 -0
  38. package/dist/example/linkedProviders/persistCallbackAuthorization.d.ts +30 -0
  39. package/dist/example/linkedProviders/resolver.d.ts +1 -0
  40. package/dist/example/linkedProviders/stores.d.ts +9 -0
  41. package/dist/example/pages/Connectors.d.ts +1 -0
  42. package/dist/example/pages/Home.d.ts +1 -0
  43. package/dist/example/pages/NotAuthorized.d.ts +1 -0
  44. package/dist/example/pages/Protected.d.ts +1 -0
  45. package/dist/example/pages/Settings.d.ts +1 -0
  46. package/dist/example/server.d.ts +902 -0
  47. package/dist/example/styles/authModalStyles.d.ts +22 -0
  48. package/dist/example/styles/navbarStyles.d.ts +15 -0
  49. package/dist/example/styles/styles.d.ts +15 -0
  50. package/dist/example/utils/absoluteAuthConfig.d.ts +4 -0
  51. package/dist/example/utils/constants.d.ts +1 -0
  52. package/dist/example/utils/navbarData.d.ts +2 -0
  53. package/dist/example/utils/providerData.d.ts +9 -0
  54. package/dist/example/utils/providersConfiguration.d.ts +1 -0
  55. package/dist/example/utils/typeGuards.d.ts +1 -0
  56. package/dist/example/utils/types.d.ts +26 -0
  57. package/dist/index.d.ts +1 -0
  58. package/dist/index.js +360 -246
  59. package/dist/index.js.map +7 -6
  60. package/dist/src/index.d.ts +1 -0
  61. package/dist/src/neonAuthSessionStore.d.ts +563 -0
  62. package/package.json +86 -74
  63. package/.claude/settings.local.json +0 -5
  64. package/.env.example +0 -212
  65. package/.prettierignore +0 -4
  66. package/.prettierrc.json +0 -9
  67. package/CLAUDE.md +0 -91
  68. package/drizzle.config.ts +0 -14
  69. package/eslint.config.mjs +0 -251
package/package.json CHANGED
@@ -1,76 +1,88 @@
1
1
  {
2
- "version": "0.22.5",
3
- "name": "@absolutejs/auth",
4
- "description": "An authorization library for absolutejs",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/absolutejs/absolute-auth.git"
8
- },
9
- "main": "dist/index.js",
10
- "license": "CC BY-NC 4.0",
11
- "author": "Alex Kahn",
12
- "scripts": {
13
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json",
14
- "test": "echo \"Error: no test specified\" && exit 1",
15
- "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json}\"",
16
- "dev": "bun run --watch example/server.ts",
17
- "db:push": "drizzle-kit push",
18
- "db:migrate": "bun run ./example/db/migrate.ts",
19
- "db:studio": "drizzle-kit studio",
20
- "lint": "eslint ./src ./example ./eslint.config.mjs",
21
- "typecheck": "bun run tsc --noEmit",
22
- "release": "bun run format && bun run build && bun publish"
23
- },
24
- "keywords": [
25
- "authorization",
26
- "authentication",
27
- "absolutejs",
28
- "elysia",
29
- "oauth"
30
- ],
31
- "types": "dist/src/index.d.ts",
32
- "peerDependencies": {
33
- "elysia": ">= 1.4.26"
34
- },
35
- "dependencies": {
36
- "@absolutejs/linked-providers": "0.0.2",
37
- "citra": "0.25.11",
38
- "@neondatabase/serverless": "1.0.0",
39
- "drizzle-orm": "0.41.0"
40
- },
41
- "devDependencies": {
42
- "@absolutejs/absolute": "0.12.3",
43
- "@tanstack/react-query": "5.79.0",
44
- "@elysiajs/eden": "1.2.0",
45
- "@elysiajs/static": "1.2.0",
46
- "@react-spring/web": "10.0.0-beta.0",
47
- "@stylistic/eslint-plugin-ts": "4.2.0",
48
- "@types/bun": "1.2.9",
49
- "@types/react": "19.1.1",
50
- "@types/react-dom": "19.1.2",
51
- "drizzle-kit": "0.30.6",
52
- "elysia": "1.4.26",
53
- "eslint": "9.26.0",
54
- "eslint-plugin-absolute": "0.0.3",
55
- "eslint-plugin-import": "2.31.0",
56
- "eslint-plugin-jsx-a11y": "6.10.2",
57
- "eslint-plugin-promise": "7.2.1",
58
- "eslint-plugin-react": "7.37.5",
59
- "eslint-plugin-react-compiler": "19.1.0-rc.1",
60
- "eslint-plugin-react-hooks": "5.2.0",
61
- "eslint-plugin-security": "3.0.1",
62
- "prettier": "3.5.3",
63
- "react": "19.1.0",
64
- "react-dom": "19.1.0",
65
- "react-icons": "5.5.0",
66
- "typescript": "5.8.3",
67
- "typescript-eslint": "8.32.0"
68
- },
69
- "module": "dist/index.js",
70
- "exports": {
71
- ".": {
72
- "types": "./dist/src/index.d.ts",
73
- "default": "./dist/index.js"
74
- }
75
- }
2
+ "version": "0.22.6",
3
+ "name": "@absolutejs/auth",
4
+ "description": "An authorization library for absolutejs",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/absolutejs/absolute-auth.git"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "license": "CC BY-NC 4.0",
11
+ "author": "Alex Kahn",
12
+ "scripts": {
13
+ "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json && bun -e \"await Bun.write(\\\"dist/index.d.ts\\\", \\\"export * from \\\\\\\"./src/index\\\\\\\";\\n\\\")\"",
14
+ "test": "echo \"Error: no test specified\" && exit 1",
15
+ "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json}\"",
16
+ "dev": "bun run --watch example/server.ts",
17
+ "db:push": "drizzle-kit push",
18
+ "db:migrate": "bun run ./example/db/migrate.ts",
19
+ "db:studio": "drizzle-kit studio",
20
+ "lint": "eslint ./src ./example ./eslint.config.mjs",
21
+ "typecheck": "bun run tsc --noEmit",
22
+ "release": "bun run format && bun run build && bun publish"
23
+ },
24
+ "keywords": [
25
+ "authorization",
26
+ "authentication",
27
+ "absolutejs",
28
+ "elysia",
29
+ "oauth"
30
+ ],
31
+ "types": "./dist/index.d.ts",
32
+ "peerDependencies": {
33
+ "elysia": ">= 1.4.26"
34
+ },
35
+ "dependencies": {
36
+ "@absolutejs/linked-providers": "0.0.2",
37
+ "citra": "0.25.11",
38
+ "@neondatabase/serverless": "1.0.0",
39
+ "drizzle-orm": "0.41.0"
40
+ },
41
+ "devDependencies": {
42
+ "@absolutejs/absolute": "0.12.3",
43
+ "@tanstack/react-query": "5.79.0",
44
+ "@elysiajs/eden": "1.2.0",
45
+ "@elysiajs/static": "1.2.0",
46
+ "@react-spring/web": "10.0.0-beta.0",
47
+ "@stylistic/eslint-plugin-ts": "4.2.0",
48
+ "@types/bun": "1.2.9",
49
+ "@types/react": "19.1.1",
50
+ "@types/react-dom": "19.1.2",
51
+ "drizzle-kit": "0.30.6",
52
+ "elysia": "1.4.26",
53
+ "eslint": "9.26.0",
54
+ "eslint-plugin-absolute": "0.0.3",
55
+ "eslint-plugin-import": "2.31.0",
56
+ "eslint-plugin-jsx-a11y": "6.10.2",
57
+ "eslint-plugin-promise": "7.2.1",
58
+ "eslint-plugin-react": "7.37.5",
59
+ "eslint-plugin-react-compiler": "19.1.0-rc.1",
60
+ "eslint-plugin-react-hooks": "5.2.0",
61
+ "eslint-plugin-security": "3.0.1",
62
+ "prettier": "3.5.3",
63
+ "react": "19.1.0",
64
+ "react-dom": "19.1.0",
65
+ "react-icons": "5.5.0",
66
+ "typescript": "5.8.3",
67
+ "typescript-eslint": "8.32.0"
68
+ },
69
+ "module": "./dist/index.js",
70
+ "exports": {
71
+ ".": {
72
+ "import": "./dist/index.js",
73
+ "types": "./dist/index.d.ts"
74
+ }
75
+ },
76
+ "type": "module",
77
+ "files": [
78
+ "dist",
79
+ "README.md"
80
+ ],
81
+ "typesVersions": {
82
+ "*": {
83
+ "*": [
84
+ "dist/index.d.ts"
85
+ ]
86
+ }
87
+ }
76
88
  }
@@ -1,5 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": ["Bash(bun run typecheck:*)", "Bash(bun lint:*)"]
4
- }
5
- }
package/.env.example DELETED
@@ -1,212 +0,0 @@
1
- # FORTY_TWO_CLIENT_ID=12345678901234567890123456789012
2
- # FORTY_TWO_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
3
-
4
- # AMAZON_COGNITO_CLIENT_ID=012345678901234567890123456789012
5
- # AMAZON_COGNITO_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
6
- # AMAZON_COGNITO_DOMAIN=your-cognito-domain.auth.us-east-1.amazoncognito.com
7
-
8
- # ANILIST_CLIENT_ID=12345678901234567890123456789012
9
- # ANILIST_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
10
-
11
- # APPLE_CLIENT_ID=1234567890.com.example.app
12
- # APPLE_TEAM_ID=your-apple-team-id
13
- # APPLE_PKCS8_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----
14
- # APPLE_KEY_ID=your-apple-key-id
15
-
16
- # ATLASSIAN_CLIENT_ID=12345678901234567890123456789012
17
- # ATLASSIAN_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
18
-
19
- # AUTH0_CLIENT_ID=12345678901234567890123456789012
20
- # AUTH0_CLIENT_SECRET=12345678901234567890123456789012
21
- # AUTH0_DOMAIN=your-auth0-domain.auth0.com
22
-
23
- # AUTHENTIK_CLIENT_ID=12345678901234567890123456789012
24
- # AUTHENTIK_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
25
- # AUTHENTIK_BASE_URL=http://localhost:3000
26
-
27
- # AUTODESK_CLIENT_ID=12345678901234567890123456789012
28
- # AUTODESK_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
29
-
30
- # BATTLENET_CLIENT_ID=123
31
- # BATTLENET_CLIENT_SECRET=123
32
-
33
- # BITBUCKET_CLIENT_ID=12345678901234567890123456789012
34
- # BITBUCKET_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
35
-
36
- # BOX_CLIENT_ID=12345678901234567890123456789012
37
- # BOX_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
38
-
39
- # BUNGIE_CLIENT_ID=12345678901234567890123456789012
40
- # BUNGIE_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
41
- # BUNGIE_API_KEY=12345678901234567890123456789012 # TODO: This needs to be added to the request headers as "X-API-Key"
42
-
43
- # COINBASE_CLIENT_ID=12345678901234567890123456789012
44
- # COINBASE_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
45
-
46
- # DISCORD_CLIENT_ID=12345678901234567890123456789012
47
- # DISCORD_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
48
-
49
- # DONATION_ALERTS_CLIENT_ID=12345678901234567890123456789012
50
- # DONATION_ALERTS_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
51
-
52
- # DRIBBBLE_CLIENT_ID=12345678901234567890123456789012
53
- # DRIBBBLE_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
54
-
55
- # DROPBOX_APP_KEY=12345678901234567890123456789012
56
- # DROPBOX_APP_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
57
-
58
- # EPIC_GAMES_CLIENT_ID=123456789012345678901234567890123
59
- # EPIC_GAMES_CLIENT_SECRET=1234567890123456789012345678901234567890
60
-
61
- # ETSY_KEYSTRING=12345678901234567890123456789012
62
- # ETSY_SHARED_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
63
-
64
- # FACEBOOK_CLIENT_ID=12345678901234567890123456789012
65
- # FACEBOOK_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
66
-
67
- # FIGMA_CLIENT_ID=12345678901234567890123456789012
68
- # FIGMA_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
69
-
70
- # GITEA_BASE_URL=https://try.gitea.io
71
- # GITEA_CLIENT_ID=12345678901234567890123456789012
72
- # GITEA_CLIENT_SECRET=12345678901234567890123456789012
73
-
74
- # GITHUB_CLIENT_ID=12345678901234567890123456789012
75
- # GITHUB_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
76
-
77
- # GITLAB_CLIENT_ID=123456789012345678901234567890123
78
- # GITLAB_CLIENT_SECRET=12345678901234567890123456789012
79
- # GITLAB_BASE_URL=https://gitlab.com
80
-
81
- # GOOGLE_CLIENT_ID=12345678901234567890123456789012
82
- # GOOGLE_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
83
-
84
- # INTUIT_CLIENT_ID=123456789012345678901234567890123
85
- # INTUIT_CLIENT_SECRET=1234567890123456789012345678901234567890
86
-
87
- # KAKAO_CLIENT_ID=12345678901234567890123456789012
88
- # KAKAO_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
89
-
90
- # KEYCLOAK_CLIENT_ID=12345678901234567890123456789012
91
- # KEYCLOAK_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
92
- # KEYCLOAK_REALM_URL=http://localhost:8080/auth/realms/master
93
-
94
- # KICK_CLIENT_ID=123
95
- # KICK_CLIENT_SECRET=12345678901234567890123456789012
96
-
97
- # LICHESS_CLIENT_ID=YOUR_APP_ID
98
-
99
- # LINE_CHANNEL_ID=1234567890
100
- # LINE_CHANNEL_SECRET=1234567890abcdef1234567890abcdef
101
-
102
- # LINEAR_CLIENT_ID=12345678901234567890123456789012
103
- # LINEAR_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
104
-
105
- # LINKEDIN_CLIENT_ID=12345678901234567890123456789012
106
- # LINKEDIN_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
107
-
108
- # MASTODON_CLIENT_ID=12345678901234567890123456789012
109
- # MASTODON_CLIENT_SECRET=1234567890123456789012345678901234567890123456789012345678901234567890
110
- # MASTODON_BASE_URL=https://mastodon.social
111
-
112
- # MERCADO_LIBRE_CLIENT_ID=1234567890123456
113
- # MERCADO_LIBRE_CLIENT_SECRET=12345678901234567890123456789012
114
-
115
- # MERCADO_PAGO_CLIENT_ID=1234567890123456
116
- # MERCADO_PAGO_CLIENT_SECRET=12345678901234567890123456789012
117
-
118
- # MICROSOFT_ENTRA_ID_CLIENT_ID=12345678-1234-1234-1234-123456789012
119
- # MICROSOFT_ENTRA_ID_CLIENT_SECRET=1234567890abcdef1234567890abcdef12345678
120
- # MICROSOFT_ENTRA_ID_TENANT_ID=12345678-1234-1234-1234-123456789012
121
-
122
- # MY_ANIME_LIST_CLIENT_ID=12345678901234567890123456789012
123
- # MY_ANIME_LIST_CLIENT_SECRET=1234567890123456789012345678901234567890123456789012345678901234567890
124
-
125
- # NAVER_CLIENT_ID=12345678901234567890123456789012
126
- # NAVER_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
127
-
128
- # NOTION_CLIENT_ID=123456789012345678901234567890123
129
- # NOTION_CLIENT_SECRET=1234567890123456789012345678901234567890
130
-
131
- # OKTA_CLIENT_ID=123
132
- # OKTA_CLIENT_SECRET=12345678901234567890123456789012
133
- # OKTA_DOMAIN=dev-1234567.okta.com
134
-
135
- # OSU_CLIENT_ID=12345678901234567890123456789012
136
- # OSU_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
137
-
138
- # PATREON_CLIENT_ID=12345678901234567890123456789012
139
- # PATREON_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
140
-
141
- # POLAR_CLIENT_ID=polar_ci_12345678901234567890123456789012
142
- # POLAR_CLIENT_SECRET=polar_cs_12345678901234567890123456789012
143
-
144
- # POLAR_ACCESSLINK_CLIENT_ID=12345678901234567890123456789012
145
- # POLAR_ACCESSLINK_CLIENT_SECRET=12345678901234567890123456789012
146
-
147
- # POLAR_TEAM_PRO_CLIENT_ID=123456789012345678901234567890123456789012
148
- # POLAR_TEAM_PRO_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
149
-
150
- # REDDIT_CLIENT_ID=123456789012345678901234567890123
151
- # REDDIT_CLIENT_SECRET=1234567890123456789012345678901234567890
152
-
153
- # ROBLOX_CLIENT_ID=12345678901234567890123456789012
154
- # ROBLOX_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
155
-
156
- # SALESFORCE_CONSUMER_KEY=1234567890123456789012345678901234567890123456789012345678901234567890
157
- # SALESFORCE_CONSUMER_SECRET=1234567890123456789012345678901234567890123456789012345678901234567890
158
-
159
- # SHIKIMORI_CLIENT_ID=12345678901234567890123456789012
160
- # SHIKIMORI_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
161
-
162
- # SLACK_CLIENT_ID=12345678901234567890123456789012
163
- # SLACK_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
164
-
165
- # SPOTIFY_CLIENT_ID=12345678901234567890123456789012
166
- # SPOTIFY_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
167
-
168
- # STARTGG_CLIENT_ID=123
169
- # STARTGG_CLIENT_SECRET=12345678901234567890123456789012
170
-
171
- # STRAVA_CLIENT_ID=12345678901234567890123456789012
172
- # STRAVA_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
173
-
174
- # SYNOLOGY_CLIENT_ID=12345678901234567890123456789012
175
- # SYNOLOGY_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
176
-
177
- # TIK_TOK_CLIENT_KEY=12345678901234567890123456789012
178
- # TIK_TOK_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
179
-
180
- # TILTIFY_CLIENT_ID=12345678901234567890123456789012
181
- # TILTIFY_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
182
-
183
- # TUMBLR_CONSUMER_KEY=12345678901234567890123456789012
184
- # TUMBLR_CONSUMER_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
185
-
186
- # TWITCH_CLIENT_ID=12345678901234567890123456789012
187
- # TWITCH_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
188
-
189
- # TWITTER_CLIENT_ID=12345678901234567890123456789012
190
- # TWITTER_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
191
-
192
- # VK_CLIENT_ID=1234567890123456
193
- # VK_CLIENT_SECRET=12345678901234567890123456789012
194
-
195
- # WITHINGS_CLIENT_ID = 12345678901234567890123456789012
196
- # WITHINGS_CLIENT_SECRET = 1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
197
-
198
- # WORK_OS_CLIENT_ID=12345678901234567890123456789012
199
- # WORK_OS_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
200
-
201
- # YAHOO_CLIENT_ID=123
202
- # YAHOO_CLIENT_SECRET=12345678901234567890123456789012
203
-
204
- # YANDEX_CLIENT_ID=12345678901234567890123456789012
205
- # YANDEX_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
206
-
207
- # ZOOM_CLIENT_ID=12345678901234567890123456789012
208
- # ZOOM_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f
209
-
210
- # OAUTH2_CALLBACK_URI = http://localhost:3000/oauth2/callback
211
-
212
- # DATABASE_URL = postgres://user:password@localhost:5432/database
package/.prettierignore DELETED
@@ -1,4 +0,0 @@
1
- node_modules
2
- dist
3
- build
4
- *.min.js
package/.prettierrc.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "semi": true,
3
- "trailingComma": "none",
4
- "singleQuote": true,
5
- "printWidth": 80,
6
- "tabWidth": 4,
7
- "endOfLine": "auto",
8
- "useTabs": true
9
- }
package/CLAUDE.md DELETED
@@ -1,91 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- Absolute Auth is a TypeScript OAuth2 authentication library for the Elysia web framework. It provides session management, multi-provider OAuth2 support, and route protection utilities. Built for Bun runtime.
8
-
9
- ## Commands
10
-
11
- ```bash
12
- bun run build # Bundle with Bun, generate TypeScript declarations
13
- bun run typecheck # TypeScript type checking
14
- bun run format # Prettier formatting
15
- bun run dev # Watch and run example server
16
- bun run release # Full pipeline: lint, format, build, publish
17
-
18
- # Database (example app)
19
- bun db:push # Drizzle migration push
20
- bun db:migrate # Custom migration runner
21
- bun db:studio # Drizzle Studio interface
22
- ```
23
-
24
- ## Architecture
25
-
26
- ### Core Module Pattern
27
-
28
- Each auth feature (`authorize`, `callback`, `refresh`, `revoke`, `signout`, `userStatus`, `profile`) is a standalone module that returns an Elysia instance. The main `absoluteAuth<UserType>(config)` function composes all modules using Elysia's `.use()` pattern.
29
-
30
- ### OAuth2 Flow
31
-
32
- 1. **authorize.ts** - Sets state/code_verifier/origin cookies, redirects to provider
33
- 2. **callback.ts** - Validates authorization code, exchanges for tokens, creates/retrieves user, stores session
34
- 3. **userStatus.ts** - Returns current session status
35
- 4. **refresh.ts** - Refreshes tokens for providers that support it
36
- 5. **revoke.ts** - Revokes tokens for providers that support it
37
- 6. **signout.ts** - Cleans up session and cookies
38
-
39
- ### Session Management
40
-
41
- - Sessions stored in Elysia state (`sessionStore.ts`)
42
- - Session ID in httpOnly secure cookie (UUID v4)
43
- - Two session types: `SessionRecord<UserType>` (authenticated) and `UnregisteredSessionRecord` (during OAuth flow)
44
- - Always check `expiresAt` timestamp before using session
45
-
46
- ### Generic UserType Pattern
47
-
48
- All modules are generic over `<UserType>`. The config requires a `getUser(decoded)` function that returns your user type from decoded token data. This keeps the library agnostic to your user model.
49
-
50
- ### Event Handler Pattern
51
-
52
- Lifecycle hooks follow `On<Event><Success|Error>` naming:
53
- - `OnCallbackSuccess`, `OnCallbackError`
54
- - `OnAuthorizeError`, `OnRefreshSuccess`, etc.
55
-
56
- Handlers receive context objects and can return `Response`, status object, or `undefined`.
57
-
58
- ## Code Conventions
59
-
60
- ### ESLint Rules (from @absolutejs plugin)
61
-
62
- - No default exports (except eslint config)
63
- - Minimum variable name length: 3 characters
64
- - Enforce sorted exports and object keys
65
- - Maximum nesting depth enforced
66
-
67
- ### Formatting
68
-
69
- - Tabs (width 4), not spaces
70
- - Single quotes, semicolons
71
- - Trailing commas: none
72
- - Print width: 80
73
-
74
- ### Type Safety
75
-
76
- - Strict mode enabled
77
- - Use provided type guards from `typeGuards.ts` for runtime validation
78
- - Always return typed status responses or Response objects for errors
79
-
80
- ## Key Files
81
-
82
- - `src/index.ts` - Main export, composes all auth routes
83
- - `src/types.ts` - Core type definitions
84
- - `src/utils.ts` - Session validation, instantiation helpers
85
- - `src/constants.ts` - Cookie/session duration constants
86
- - `example/server.ts` - Reference implementation
87
-
88
- ## Dependencies
89
-
90
- - **elysia** - Web framework (peer dependency)
91
- - **citra** - OAuth2 client management (provides provider configs, PKCE utilities)
package/drizzle.config.ts DELETED
@@ -1,14 +0,0 @@
1
- import { defineConfig } from 'drizzle-kit';
2
-
3
- if (!process.env.DATABASE_URL) {
4
- throw new Error('DATABASE_URL must be set in the environment variables');
5
- }
6
-
7
- export default defineConfig({
8
- dialect: 'postgresql',
9
- schema: './example/db/schema.ts',
10
- out: './db/migrations',
11
- dbCredentials: {
12
- url: process.env.DATABASE_URL
13
- }
14
- });