@luckystack/login 0.1.7 → 0.1.8
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/CLAUDE.md +1 -1
- package/README.md +5 -5
- package/docs/oauth-providers.md +5 -5
- package/package.json +3 -3
package/CLAUDE.md
CHANGED
|
@@ -138,7 +138,7 @@ All config keys live on `ProjectConfig` (from `@luckystack/core`). Resolved at c
|
|
|
138
138
|
| `FACEBOOK_CLIENT_ID` / `FACEBOOK_CLIENT_SECRET` | `facebookProvider` | OAuth app credentials. |
|
|
139
139
|
| `MICROSOFT_CLIENT_ID` / `MICROSOFT_CLIENT_SECRET` | `microsoftProvider` | OAuth app credentials. |
|
|
140
140
|
| `MICROSOFT_TENANT_ID` | `microsoftProvider` (optional) | Single-tenant Azure AD. Defaults to `'common'`. |
|
|
141
|
-
|
|
|
141
|
+
| (callback origin) | All OAuth `callbackUrl` builders | The `callbackUrl` is the BACKEND origin + `/auth/callback/<provider>`. The scaffold derives it in `config.ts` (`oauthCallbackBase`: dev `http://localhost:80`, prod the public domain). No `DNS` env var — that was removed in 0.1.5. |
|
|
142
142
|
| `BCRYPT_ROUNDS` | `auth.bcryptRounds` | Surfaced through project config; salt rounds for credentials hashing. |
|
|
143
143
|
|
|
144
144
|
> Env-key set without the matching package installed = hard boot crash (see peer-dep guard policy). `@luckystack/email` is the optional case — login lazy-imports it and gracefully fails when `forgotPassword !== 'framework'`.
|
package/README.md
CHANGED
|
@@ -57,12 +57,12 @@ registerOAuthProviders([
|
|
|
57
57
|
googleProvider({
|
|
58
58
|
clientId: process.env.GOOGLE_CLIENT_ID,
|
|
59
59
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
60
|
-
callbackUrl:
|
|
60
|
+
callbackUrl: `http://localhost:80/auth/callback/google`,
|
|
61
61
|
}),
|
|
62
62
|
githubProvider({
|
|
63
63
|
clientId: process.env.GITHUB_CLIENT_ID,
|
|
64
64
|
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
|
65
|
-
callbackUrl:
|
|
65
|
+
callbackUrl: `http://localhost:80/auth/callback/github`,
|
|
66
66
|
}),
|
|
67
67
|
]);
|
|
68
68
|
```
|
|
@@ -77,7 +77,7 @@ Every helper accepts the base shape plus optional overrides for self-hosted inst
|
|
|
77
77
|
| --- | --- | --- | --- |
|
|
78
78
|
| `clientId` | all | — | Required. The OAuth app's client identifier. |
|
|
79
79
|
| `clientSecret` | all | — | Required. The OAuth app's client secret. |
|
|
80
|
-
| `callbackUrl` | all | — | Required. Must match the URL registered with the provider
|
|
80
|
+
| `callbackUrl` | all | — | Required. Must match the URL registered with the provider — your BACKEND origin + `/auth/callback/<name>` (dev `http://localhost:80/auth/callback/<name>`, prod `https://your-domain.com/auth/callback/<name>`). |
|
|
81
81
|
| `endpoints?.authorizationURL` | all | provider-default | GitHub Enterprise host, Microsoft custom-tenant authorize URL, internal auth proxy, etc. |
|
|
82
82
|
| `endpoints?.tokenExchangeURL` | all | provider-default | Same use cases as `authorizationURL`. |
|
|
83
83
|
| `endpoints?.userInfoURL` | all | provider-default | Self-hosted GitHub Enterprise / Microsoft Graph mirror, etc. |
|
|
@@ -91,7 +91,7 @@ Example — self-hosted GitHub Enterprise:
|
|
|
91
91
|
githubProvider({
|
|
92
92
|
clientId: process.env.GITHUB_CLIENT_ID,
|
|
93
93
|
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
|
94
|
-
callbackUrl:
|
|
94
|
+
callbackUrl: `http://localhost:80/auth/callback/github`,
|
|
95
95
|
endpoints: {
|
|
96
96
|
authorizationURL: 'https://github.acme.example/login/oauth/authorize',
|
|
97
97
|
tokenExchangeURL: 'https://github.acme.example/login/oauth/access_token',
|
|
@@ -106,7 +106,7 @@ Example — single-tenant Microsoft Entra ID:
|
|
|
106
106
|
microsoftProvider({
|
|
107
107
|
clientId: process.env.MICROSOFT_CLIENT_ID,
|
|
108
108
|
clientSecret: process.env.MICROSOFT_CLIENT_SECRET,
|
|
109
|
-
callbackUrl:
|
|
109
|
+
callbackUrl: `http://localhost:80/auth/callback/microsoft`,
|
|
110
110
|
tenant: process.env.MICROSOFT_TENANT_ID, // 'common' for any tenant; UUID for a single tenant.
|
|
111
111
|
apiVersion: 'v2.0', // OAuth endpoint version
|
|
112
112
|
graphApiVersion: 'v1.0', // Graph endpoint version
|
package/docs/oauth-providers.md
CHANGED
|
@@ -42,12 +42,12 @@ registerOAuthProviders([
|
|
|
42
42
|
googleProvider({
|
|
43
43
|
clientId: process.env.GOOGLE_CLIENT_ID,
|
|
44
44
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
45
|
-
callbackUrl:
|
|
45
|
+
callbackUrl: `http://localhost:80/auth/callback/google`,
|
|
46
46
|
}),
|
|
47
47
|
githubProvider({
|
|
48
48
|
clientId: process.env.GITHUB_CLIENT_ID,
|
|
49
49
|
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
|
50
|
-
callbackUrl:
|
|
50
|
+
callbackUrl: `http://localhost:80/auth/callback/github`,
|
|
51
51
|
}),
|
|
52
52
|
]);
|
|
53
53
|
```
|
|
@@ -138,7 +138,7 @@ export const isFullOAuthProvider = (provider: OAuthProvider): provider is FullOA
|
|
|
138
138
|
| `name` | URL slug used in `/auth/callback/<name>` and stored on `User.provider`. |
|
|
139
139
|
| `clientID` | OAuth app client id. |
|
|
140
140
|
| `clientSecret` | OAuth app secret. |
|
|
141
|
-
| `callbackURL` | Must match the URL registered with the provider
|
|
141
|
+
| `callbackURL` | Must match the URL registered with the provider — your BACKEND origin + `/auth/callback/<name>` (dev `http://localhost:80/...`, prod your domain). |
|
|
142
142
|
| `authorizationURL` | Where to redirect the user to authorize (start of the flow). |
|
|
143
143
|
| `tokenExchangeURL` | POST endpoint for exchanging `code` → `access_token`. |
|
|
144
144
|
| `tokenExchangeMethod` | `'json'` (Google) or `'form'` (Discord, Facebook, Microsoft). GitHub accepts either; we use `'json'`. |
|
|
@@ -392,7 +392,7 @@ registerOAuthProviders([
|
|
|
392
392
|
oktaProvider({
|
|
393
393
|
clientId: process.env.OKTA_CLIENT_ID,
|
|
394
394
|
clientSecret: process.env.OKTA_CLIENT_SECRET,
|
|
395
|
-
callbackUrl:
|
|
395
|
+
callbackUrl: `http://localhost:80/auth/callback/okta`,
|
|
396
396
|
domain: 'acme.okta.com',
|
|
397
397
|
}),
|
|
398
398
|
]);
|
|
@@ -411,7 +411,7 @@ For self-hosted GitHub Enterprise / GitLab / Gitea, use the `endpoints?.*` overr
|
|
|
411
411
|
githubProvider({
|
|
412
412
|
clientId: process.env.GITHUB_CLIENT_ID,
|
|
413
413
|
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
|
414
|
-
callbackUrl:
|
|
414
|
+
callbackUrl: `http://localhost:80/auth/callback/github`,
|
|
415
415
|
endpoints: {
|
|
416
416
|
authorizationURL: 'https://github.acme.example/login/oauth/authorize',
|
|
417
417
|
tokenExchangeURL: 'https://github.acme.example/login/oauth/access_token',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luckystack/login",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"test": "vitest run"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@luckystack/core": "^0.1.
|
|
57
|
+
"@luckystack/core": "^0.1.8",
|
|
58
58
|
"bcryptjs": "^3.0.0",
|
|
59
59
|
"dotenv": "^17.0.0",
|
|
60
60
|
"validator": "^13.15.35"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@prisma/client": "^6.19.0",
|
|
64
64
|
"socket.io": "^4.8.0",
|
|
65
|
-
"@luckystack/email": "^0.1.
|
|
65
|
+
"@luckystack/email": "^0.1.8"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@luckystack/email": {
|