@frontegg/nextjs 7.0.15 → 7.0.16-alpha.5588975247
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/CHANGELOG.md +22 -0
- package/api/urls.d.ts +3 -1
- package/api/urls.js +4 -2
- package/api/urls.js.map +1 -1
- package/app/createTenantResolverForClientProvider.js +1 -1
- package/app/createTenantResolverForClientProvider.js.map +1 -1
- package/edge/redirectToLogin.d.ts +11 -1
- package/edge/redirectToLogin.js +14 -2
- package/edge/redirectToLogin.js.map +1 -1
- package/index.js +1 -1
- package/package.json +3 -3
- package/sdkVersion.js +1 -1
- package/sdkVersion.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
## [7.0.16](https://github.com/frontegg/frontegg-nextjs/compare/v7.0.15...v7.0.16) (2023-7-18)
|
|
4
|
+
|
|
5
|
+
- FR-12696 - Entitlements redesign
|
|
6
|
+
- FR-12537 - recomendations component
|
|
7
|
+
- FR-12675 - add security center context holder and mappers for recommendations/insights
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
- FR-12703 - Make sure to update correctly the change log in wrappers
|
|
11
|
+
- FR-12688 - Make Admin box compatible with the updated type of IUserProfile
|
|
12
|
+
- FR-12649 - Added a skeleton for the new security center page
|
|
13
|
+
|
|
14
|
+
- FR-12114 - Shouldn't show inactive custom social login provider
|
|
15
|
+
- FR-12098 - FR-12020 - admin portal user status update if email verification is off + blinking workspace title in admin portal vivid theme
|
|
16
|
+
- FR-12660 - implement sagas for security center admin portal
|
|
17
|
+
- FR-12664 - Rename redux-saga file to prevent loop imports by webpack
|
|
18
|
+
- FR-12652 - init new security page. wrap with ff
|
|
19
|
+
|
|
20
|
+
### NextJS Wrapper 7.0.16:
|
|
21
|
+
- FR-12634 - next-js-package-support-sub-domain-for-custom-login-boxes
|
|
22
|
+
- FR-12629 - preserve search params for withSSRSession
|
|
1
23
|
# Change Log
|
|
2
24
|
|
|
3
25
|
## [7.0.15](https://github.com/frontegg/frontegg-nextjs/compare/v7.0.14...v7.0.15) (2023-7-13)
|
package/api/urls.d.ts
CHANGED
|
@@ -15,11 +15,13 @@ interface BuildRouteResult {
|
|
|
15
15
|
* Builds a login route with a redirect URL encoded as a query parameter.
|
|
16
16
|
*
|
|
17
17
|
* @param {string} redirectUrl - The URL to redirect to after successful login.
|
|
18
|
+
* @param {URLSearchParams} searchParams - optional The URL search Params to preserve to login
|
|
19
|
+
* @param {string} baseUrl - optional The login base URL the user will be redirected to (default .env.local FRONTEGG_APP_URL)
|
|
18
20
|
* @returns {BuildRouteResult} An object containing the generated login route and URL.
|
|
19
21
|
*
|
|
20
22
|
* @throws {TypeError} If redirectUrl is not a string.
|
|
21
23
|
*/
|
|
22
|
-
export declare function buildLoginRoute(redirectUrl: string, searchParams?: URLSearchParams): BuildRouteResult;
|
|
24
|
+
export declare function buildLoginRoute(redirectUrl: string, searchParams?: URLSearchParams, baseUrl?: string): BuildRouteResult;
|
|
23
25
|
/**
|
|
24
26
|
* Builds a HostedLogin's logout route with a redirect URL encoded as a query parameter.
|
|
25
27
|
*
|
package/api/urls.js
CHANGED
|
@@ -23,12 +23,14 @@ exports.ApiUrls = ApiUrls;
|
|
|
23
23
|
* Builds a login route with a redirect URL encoded as a query parameter.
|
|
24
24
|
*
|
|
25
25
|
* @param {string} redirectUrl - The URL to redirect to after successful login.
|
|
26
|
+
* @param {URLSearchParams} searchParams - optional The URL search Params to preserve to login
|
|
27
|
+
* @param {string} baseUrl - optional The login base URL the user will be redirected to (default .env.local FRONTEGG_APP_URL)
|
|
26
28
|
* @returns {BuildRouteResult} An object containing the generated login route and URL.
|
|
27
29
|
*
|
|
28
30
|
* @throws {TypeError} If redirectUrl is not a string.
|
|
29
31
|
*/
|
|
30
|
-
function buildLoginRoute(redirectUrl, searchParams) {
|
|
31
|
-
const asPath = `${
|
|
32
|
+
function buildLoginRoute(redirectUrl, searchParams, baseUrl = _config.default.appUrl) {
|
|
33
|
+
const asPath = `${baseUrl}/account/login?redirectUrl=${encodeURIComponent(redirectUrl)}${searchParams ? `&${searchParams.toString()}` : ''}`;
|
|
32
34
|
const asUrl = new URL(asPath);
|
|
33
35
|
return {
|
|
34
36
|
asPath,
|
package/api/urls.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urls.js","names":["_restApi","require","_config","_interopRequireDefault","ApiUrls","WellKnown","jwks","refreshToken","embedded","fronteggRefreshTokenUrl","hosted","exports","buildLoginRoute","redirectUrl","searchParams","
|
|
1
|
+
{"version":3,"file":"urls.js","names":["_restApi","require","_config","_interopRequireDefault","ApiUrls","WellKnown","jwks","refreshToken","embedded","fronteggRefreshTokenUrl","hosted","exports","buildLoginRoute","redirectUrl","searchParams","baseUrl","config","appUrl","asPath","encodeURIComponent","toString","asUrl","URL","buildLogoutRoute"],"sources":["../../../../packages/nextjs/src/api/urls.ts"],"sourcesContent":["import { fronteggRefreshTokenUrl } from '@frontegg/rest-api';\nimport config from '../config';\n\nexport const ApiUrls = {\n WellKnown: {\n jwks: `/.well-known/jwks.json`,\n },\n refreshToken: {\n embedded: `/frontegg${fronteggRefreshTokenUrl}`,\n hosted: `/frontegg/oauth/token`,\n },\n};\n\ninterface BuildRouteResult {\n asPath: string;\n asUrl: URL;\n}\n\n/**\n * Builds a login route with a redirect URL encoded as a query parameter.\n *\n * @param {string} redirectUrl - The URL to redirect to after successful login.\n * @param {URLSearchParams} searchParams - optional The URL search Params to preserve to login\n * @param {string} baseUrl - optional The login base URL the user will be redirected to (default .env.local FRONTEGG_APP_URL)\n * @returns {BuildRouteResult} An object containing the generated login route and URL.\n *\n * @throws {TypeError} If redirectUrl is not a string.\n */\nexport function buildLoginRoute(\n redirectUrl: string,\n searchParams?: URLSearchParams,\n baseUrl: string = config.appUrl\n): BuildRouteResult {\n const asPath = `${baseUrl}/account/login?redirectUrl=${encodeURIComponent(redirectUrl)}${\n searchParams ? `&${searchParams.toString()}` : ''\n }`;\n const asUrl = new URL(asPath);\n return {\n asPath,\n asUrl,\n };\n}\n\n/**\n * Builds a HostedLogin's logout route with a redirect URL encoded as a query parameter.\n *\n * @param {string} redirectUrl - The URL to redirect to after successful login.\n * @param {string} baseUrl - The frontegg domain url\n * @returns {BuildRouteResult} An object containing the generated login route and URL.\n *\n * @throws {TypeError} If redirectUrl is not a string.\n */\nexport function buildLogoutRoute(redirectUrl: string, baseUrl: string): BuildRouteResult {\n const asPath = `${baseUrl}/oauth/logout?post_logout_redirect_uri=${encodeURIComponent(redirectUrl)}`;\n const asUrl = new URL(asPath, baseUrl);\n return {\n asPath,\n asUrl,\n };\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEO,MAAMG,OAAO,GAAG;EACrBC,SAAS,EAAE;IACTC,IAAI,EAAG;EACT,CAAC;EACDC,YAAY,EAAE;IACZC,QAAQ,EAAG,YAAWC,gCAAwB,EAAC;IAC/CC,MAAM,EAAG;EACX;AACF,CAAC;AAACC,OAAA,CAAAP,OAAA,GAAAA,OAAA;AAOF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,eAAeA,CAC7BC,WAAmB,EACnBC,YAA8B,EAC9BC,OAAe,GAAGC,eAAM,CAACC,MAAM,EACb;EAClB,MAAMC,MAAM,GAAI,GAAEH,OAAQ,8BAA6BI,kBAAkB,CAACN,WAAW,CAAE,GACrFC,YAAY,GAAI,IAAGA,YAAY,CAACM,QAAQ,EAAG,EAAC,GAAG,EAChD,EAAC;EACF,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAACJ,MAAM,CAAC;EAC7B,OAAO;IACLA,MAAM;IACNG;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAACV,WAAmB,EAAEE,OAAe,EAAoB;EACvF,MAAMG,MAAM,GAAI,GAAEH,OAAQ,0CAAyCI,kBAAkB,CAACN,WAAW,CAAE,EAAC;EACpG,MAAMQ,KAAK,GAAG,IAAIC,GAAG,CAACJ,MAAM,EAAEH,OAAO,CAAC;EACtC,OAAO;IACLG,MAAM;IACNG;EACF,CAAC;AACH"}
|
|
@@ -14,7 +14,7 @@ const createTenantResolverForClientProvider = customLoginOptions => {
|
|
|
14
14
|
subDomainIndex,
|
|
15
15
|
paramKey
|
|
16
16
|
} = customLoginOptions;
|
|
17
|
-
if (subDomainIndex) {
|
|
17
|
+
if (subDomainIndex !== undefined) {
|
|
18
18
|
const tenant = window.location.hostname.split('.').slice(0, -2)[subDomainIndex];
|
|
19
19
|
return {
|
|
20
20
|
tenant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTenantResolverForClientProvider.js","names":["createTenantResolverForClientProvider","customLoginOptions","undefined","subDomainIndex","paramKey","tenant","window","location","hostname","split","slice","params","URLSearchParams","search","get","exports"],"sources":["../../../../packages/nextjs/src/app/createTenantResolverForClientProvider.ts"],"sourcesContent":["import { CustomLoginOptionsType } from '../types';\n\nexport const createTenantResolverForClientProvider = (customLoginOptions?: CustomLoginOptionsType) => {\n if (!customLoginOptions) {\n return undefined;\n }\n\n return () => {\n try {\n const { subDomainIndex, paramKey } = customLoginOptions;\n if (subDomainIndex) {\n const tenant = window.location.hostname.split('.').slice(0, -2)[subDomainIndex];\n return { tenant };\n }\n if (paramKey) {\n const params = new URLSearchParams(window.location.search);\n const tenant = params.get(paramKey) || undefined;\n return { tenant };\n }\n return {};\n } catch {\n return {};\n }\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,qCAAqC,GAAIC,kBAA2C,IAAK;EACpG,IAAI,CAACA,kBAAkB,EAAE;IACvB,OAAOC,SAAS;EAClB;EAEA,OAAO,MAAM;IACX,IAAI;MACF,MAAM;QAAEC,cAAc;QAAEC;MAAS,CAAC,GAAGH,kBAAkB;MACvD,IAAIE,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"createTenantResolverForClientProvider.js","names":["createTenantResolverForClientProvider","customLoginOptions","undefined","subDomainIndex","paramKey","tenant","window","location","hostname","split","slice","params","URLSearchParams","search","get","exports"],"sources":["../../../../packages/nextjs/src/app/createTenantResolverForClientProvider.ts"],"sourcesContent":["import { CustomLoginOptionsType } from '../types';\n\nexport const createTenantResolverForClientProvider = (customLoginOptions?: CustomLoginOptionsType) => {\n if (!customLoginOptions) {\n return undefined;\n }\n\n return () => {\n try {\n const { subDomainIndex, paramKey } = customLoginOptions;\n if (subDomainIndex !== undefined) {\n const tenant = window.location.hostname.split('.').slice(0, -2)[subDomainIndex];\n return { tenant };\n }\n if (paramKey) {\n const params = new URLSearchParams(window.location.search);\n const tenant = params.get(paramKey) || undefined;\n return { tenant };\n }\n return {};\n } catch {\n return {};\n }\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,qCAAqC,GAAIC,kBAA2C,IAAK;EACpG,IAAI,CAACA,kBAAkB,EAAE;IACvB,OAAOC,SAAS;EAClB;EAEA,OAAO,MAAM;IACX,IAAI;MACF,MAAM;QAAEC,cAAc;QAAEC;MAAS,CAAC,GAAGH,kBAAkB;MACvD,IAAIE,cAAc,KAAKD,SAAS,EAAE;QAChC,MAAMG,MAAM,GAAGC,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAACP,cAAc,CAAC;QAC/E,OAAO;UAAEE;QAAO,CAAC;MACnB;MACA,IAAID,QAAQ,EAAE;QACZ,MAAMO,MAAM,GAAG,IAAIC,eAAe,CAACN,MAAM,CAACC,QAAQ,CAACM,MAAM,CAAC;QAC1D,MAAMR,MAAM,GAAGM,MAAM,CAACG,GAAG,CAACV,QAAQ,CAAC,IAAIF,SAAS;QAChD,OAAO;UAAEG;QAAO,CAAC;MACnB;MACA,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,MAAM;MACN,OAAO,CAAC,CAAC;IACX;EACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAf,qCAAA,GAAAA,qCAAA"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Redirect to login page in edge environment (middleware file) using NextResponse.redirect.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} pathname - The URL path to redirect to after successful login.
|
|
6
|
+
* @param {URLSearchParams} searchParams - optional The URL search Params to preserve to login
|
|
7
|
+
* @param {string} baseUrl - optional The login base URL the user will be redirected to (default .env.local FRONTEGG_APP_URL)
|
|
8
|
+
*
|
|
9
|
+
* @returns {NextResponse} redirects to login page
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare const redirectToLogin: (pathname: string, searchParams?: URLSearchParams, baseUrl?: string) => NextResponse;
|
package/edge/redirectToLogin.js
CHANGED
|
@@ -6,10 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.redirectToLogin = void 0;
|
|
7
7
|
var _server = require("next/server");
|
|
8
8
|
var _urls = require("../api/urls");
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Redirect to login page in edge environment (middleware file) using NextResponse.redirect.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} pathname - The URL path to redirect to after successful login.
|
|
13
|
+
* @param {URLSearchParams} searchParams - optional The URL search Params to preserve to login
|
|
14
|
+
* @param {string} baseUrl - optional The login base URL the user will be redirected to (default .env.local FRONTEGG_APP_URL)
|
|
15
|
+
*
|
|
16
|
+
* @returns {NextResponse} redirects to login page
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
//consider refactor params to object on next major version
|
|
21
|
+
const redirectToLogin = (pathname, searchParams, baseUrl) => {
|
|
10
22
|
const {
|
|
11
23
|
asUrl: loginUrl
|
|
12
|
-
} = (0, _urls.buildLoginRoute)(pathname, searchParams);
|
|
24
|
+
} = (0, _urls.buildLoginRoute)(pathname, searchParams, baseUrl);
|
|
13
25
|
return _server.NextResponse.redirect(loginUrl);
|
|
14
26
|
};
|
|
15
27
|
exports.redirectToLogin = redirectToLogin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirectToLogin.js","names":["_server","require","_urls","redirectToLogin","pathname","searchParams","asUrl","loginUrl","buildLoginRoute","NextResponse","redirect","exports"],"sources":["../../../../packages/nextjs/src/edge/redirectToLogin.ts"],"sourcesContent":["import { NextResponse } from 'next/server';\nimport { buildLoginRoute } from '../api/urls';\n\nexport const redirectToLogin = (pathname: string, searchParams?: URLSearchParams) => {\n const { asUrl: loginUrl } = buildLoginRoute(pathname, searchParams);\n return NextResponse.redirect(loginUrl);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;
|
|
1
|
+
{"version":3,"file":"redirectToLogin.js","names":["_server","require","_urls","redirectToLogin","pathname","searchParams","baseUrl","asUrl","loginUrl","buildLoginRoute","NextResponse","redirect","exports"],"sources":["../../../../packages/nextjs/src/edge/redirectToLogin.ts"],"sourcesContent":["import { NextResponse } from 'next/server';\nimport { buildLoginRoute } from '../api/urls';\n\n/**\n * Redirect to login page in edge environment (middleware file) using NextResponse.redirect.\n *\n * @param {string} pathname - The URL path to redirect to after successful login.\n * @param {URLSearchParams} searchParams - optional The URL search Params to preserve to login\n * @param {string} baseUrl - optional The login base URL the user will be redirected to (default .env.local FRONTEGG_APP_URL)\n *\n * @returns {NextResponse} redirects to login page\n *\n */\n\n//consider refactor params to object on next major version\nexport const redirectToLogin = (pathname: string, searchParams?: URLSearchParams, baseUrl?: string) => {\n const { asUrl: loginUrl } = buildLoginRoute(pathname, searchParams, baseUrl);\n return NextResponse.redirect(loginUrl);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAME,eAAe,GAAGA,CAACC,QAAgB,EAAEC,YAA8B,EAAEC,OAAgB,KAAK;EACrG,MAAM;IAAEC,KAAK,EAAEC;EAAS,CAAC,GAAG,IAAAC,qBAAe,EAACL,QAAQ,EAAEC,YAAY,EAAEC,OAAO,CAAC;EAC5E,OAAOI,oBAAY,CAACC,QAAQ,CAACH,QAAQ,CAAC;AACxC,CAAC;AAACI,OAAA,CAAAT,eAAA,GAAAA,eAAA"}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/nextjs",
|
|
3
3
|
"libName": "FronteggNextJs",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.16-alpha.5588975247",
|
|
5
5
|
"author": "Frontegg LTD",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"lint-json": "eslint -c .eslintrc.json -o ./lint-report.json --format json --no-color ./src/**/*.{ts,tsx}"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@frontegg/js": "6.
|
|
31
|
-
"@frontegg/react-hooks": "6.
|
|
30
|
+
"@frontegg/js": "6.123.0",
|
|
31
|
+
"@frontegg/react-hooks": "6.123.0",
|
|
32
32
|
"http-proxy": "^1.18.1",
|
|
33
33
|
"iron-session": "^6.3.1",
|
|
34
34
|
"jose": "^4.12.2"
|
package/sdkVersion.js
CHANGED
package/sdkVersion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkVersion.js","names":["version","exports","default","_default"],"sources":["../../../packages/nextjs/src/sdkVersion.ts"],"sourcesContent":["export default { version: '7.0.
|
|
1
|
+
{"version":3,"file":"sdkVersion.js","names":["version","exports","default","_default"],"sources":["../../../packages/nextjs/src/sdkVersion.ts"],"sourcesContent":["export default { version: '7.0.16-alpha.5588975247' };\n"],"mappings":";;;;;;eAAe;EAAEA,OAAO,EAAE;AAA0B,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAC,QAAA"}
|