@poly-x/next 0.1.0-alpha.0 → 0.1.0-alpha.1
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/server.cjs +4 -2
- package/dist/server.d.cts +2 -0
- package/dist/server.d.mts +2 -0
- package/dist/server.mjs +4 -2
- package/package.json +3 -3
package/dist/server.cjs
CHANGED
|
@@ -11,7 +11,8 @@ function resolveNextConfig(overrides = {}) {
|
|
|
11
11
|
return {
|
|
12
12
|
publishableKey,
|
|
13
13
|
secret,
|
|
14
|
-
baseUrl: overrides.baseUrl ?? process.env.POLYX_BASE_URL
|
|
14
|
+
baseUrl: overrides.baseUrl ?? process.env.POLYX_BASE_URL,
|
|
15
|
+
signInUrl: overrides.signInUrl ?? process.env.NEXT_PUBLIC_POLYX_SIGN_IN_URL
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
function buildServerAuthClient(config) {
|
|
@@ -19,6 +20,7 @@ function buildServerAuthClient(config) {
|
|
|
19
20
|
config: (0, _poly_x_core.resolveConfig)({
|
|
20
21
|
key: config.publishableKey,
|
|
21
22
|
baseUrl: config.baseUrl,
|
|
23
|
+
signInUrl: config.signInUrl,
|
|
22
24
|
context: "server"
|
|
23
25
|
}),
|
|
24
26
|
transport: new _poly_x_core.FetchTransport()
|
|
@@ -80,7 +82,7 @@ function createAuthHandlers(handlersConfig = {}) {
|
|
|
80
82
|
path: "/",
|
|
81
83
|
maxAge: VERIFIER_MAX_AGE
|
|
82
84
|
});
|
|
83
|
-
const url = buildServerAuthClient(config).
|
|
85
|
+
const url = buildServerAuthClient(config).buildSignInUrl({
|
|
84
86
|
redirectUri,
|
|
85
87
|
state,
|
|
86
88
|
challenge
|
package/dist/server.d.cts
CHANGED
|
@@ -6,6 +6,8 @@ interface NextServerConfig {
|
|
|
6
6
|
/** Secret for encrypting the session cookie (AES-GCM key derivation). */
|
|
7
7
|
secret: string;
|
|
8
8
|
baseUrl?: string;
|
|
9
|
+
/** Hosted sign-in page URL the signin route redirects to. */
|
|
10
|
+
signInUrl?: string;
|
|
9
11
|
}
|
|
10
12
|
declare function resolveNextConfig(overrides?: Partial<NextServerConfig>): NextServerConfig;
|
|
11
13
|
//#endregion
|
package/dist/server.d.mts
CHANGED
|
@@ -6,6 +6,8 @@ interface NextServerConfig {
|
|
|
6
6
|
/** Secret for encrypting the session cookie (AES-GCM key derivation). */
|
|
7
7
|
secret: string;
|
|
8
8
|
baseUrl?: string;
|
|
9
|
+
/** Hosted sign-in page URL the signin route redirects to. */
|
|
10
|
+
signInUrl?: string;
|
|
9
11
|
}
|
|
10
12
|
declare function resolveNextConfig(overrides?: Partial<NextServerConfig>): NextServerConfig;
|
|
11
13
|
//#endregion
|
package/dist/server.mjs
CHANGED
|
@@ -10,7 +10,8 @@ function resolveNextConfig(overrides = {}) {
|
|
|
10
10
|
return {
|
|
11
11
|
publishableKey,
|
|
12
12
|
secret,
|
|
13
|
-
baseUrl: overrides.baseUrl ?? process.env.POLYX_BASE_URL
|
|
13
|
+
baseUrl: overrides.baseUrl ?? process.env.POLYX_BASE_URL,
|
|
14
|
+
signInUrl: overrides.signInUrl ?? process.env.NEXT_PUBLIC_POLYX_SIGN_IN_URL
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
function buildServerAuthClient(config) {
|
|
@@ -18,6 +19,7 @@ function buildServerAuthClient(config) {
|
|
|
18
19
|
config: resolveConfig({
|
|
19
20
|
key: config.publishableKey,
|
|
20
21
|
baseUrl: config.baseUrl,
|
|
22
|
+
signInUrl: config.signInUrl,
|
|
21
23
|
context: "server"
|
|
22
24
|
}),
|
|
23
25
|
transport: new FetchTransport()
|
|
@@ -79,7 +81,7 @@ function createAuthHandlers(handlersConfig = {}) {
|
|
|
79
81
|
path: "/",
|
|
80
82
|
maxAge: VERIFIER_MAX_AGE
|
|
81
83
|
});
|
|
82
|
-
const url = buildServerAuthClient(config).
|
|
84
|
+
const url = buildServerAuthClient(config).buildSignInUrl({
|
|
83
85
|
redirectUri,
|
|
84
86
|
state,
|
|
85
87
|
challenge
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poly-x/next",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
4
|
"description": "PolyX SDK for Next.js App Router - components plus server helpers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"module": "./dist/index.mjs",
|
|
45
45
|
"types": "./dist/index.d.cts",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@poly-x/
|
|
48
|
-
"@poly-x/
|
|
47
|
+
"@poly-x/core": "0.1.0-alpha.1",
|
|
48
|
+
"@poly-x/react": "0.1.0-alpha.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"next": ">=14",
|