@frontegg/nextjs 6.7.10-alpha.3922844767 → 6.7.10-alpha.3923067425

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 CHANGED
@@ -12,6 +12,7 @@
12
12
  - FR-9816 - fix version
13
13
 
14
14
  ### NextJS Wrapper 6.7.10:
15
+ - FR-10141 - Added support for logout on hosted login
15
16
  - FR-10342 - update readme for app directory
16
17
  - Update Frontegg AdminPortal to 6.58.0
17
18
  - FR-10153 - Fix app session bug without keepSessionAlive
@@ -15,10 +15,7 @@ var createOrGetFronteggApp = function (_a) {
15
15
  var session = options.session, user = options.user, tenants = options.tenants;
16
16
  var _k = session !== null && session !== void 0 ? session : {}, accessToken = _k.accessToken, refreshToken = _k.refreshToken;
17
17
  var contextOptions = __assign(__assign({ requestCredentials: 'include' }, options.contextOptions), { baseUrl: function (path) {
18
- if (fronteggAuthApiRoutes.indexOf(path) !== -1 ||
19
- path.endsWith('/postlogin') ||
20
- path.endsWith('/prelogin') ||
21
- path === '/oauth/token') {
18
+ if (fronteggAuthApiRoutes.indexOf(path) !== -1 || path.endsWith('/postlogin') || path.endsWith('/prelogin')) {
22
19
  return "".concat(options.envAppUrl, "/api");
23
20
  }
24
21
  else {
@@ -107,4 +104,4 @@ var FronteggClientProviderNext13 = function (_a) {
107
104
  };
108
105
 
109
106
  export { AppContext as A, FronteggClientProviderNext13 as F };
110
- //# sourceMappingURL=FronteggClientProviderNext13-d020161d.js.map
107
+ //# sourceMappingURL=FronteggClientProviderNext13-512c37b1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FronteggClientProviderNext13-512c37b1.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/client/index.js CHANGED
@@ -7,8 +7,8 @@ import '../api-25516652.js';
7
7
  import { useContext, useEffect } from 'react';
8
8
  import { useLoginWithRedirect, useLoginActions } from '@frontegg/react-hooks';
9
9
  import '@frontegg/rest-api';
10
- import { A as AppContext } from '../FronteggClientProviderNext13-d020161d.js';
11
- export { F as FronteggClientProviderNext13 } from '../FronteggClientProviderNext13-d020161d.js';
10
+ import { A as AppContext } from '../FronteggClientProviderNext13-512c37b1.js';
11
+ export { F as FronteggClientProviderNext13 } from '../FronteggClientProviderNext13-512c37b1.js';
12
12
  import '@frontegg/js';
13
13
  import { authInitialState } from '@frontegg/redux-store';
14
14
  import { useRouter, notFound } from 'next/navigation';
package/index.js CHANGED
@@ -30,10 +30,7 @@ var createOrGetFronteggApp = function (_a) {
30
30
  var session = options.session, user = options.user, tenants = options.tenants;
31
31
  var _k = session !== null && session !== void 0 ? session : {}, accessToken = _k.accessToken, refreshToken = _k.refreshToken;
32
32
  var contextOptions = tslib.__assign(tslib.__assign({ requestCredentials: 'include' }, options.contextOptions), { baseUrl: function (path) {
33
- if (restApi.fronteggAuthApiRoutes.indexOf(path) !== -1 ||
34
- path.endsWith('/postlogin') ||
35
- path.endsWith('/prelogin') ||
36
- path === '/oauth/token') {
33
+ if (restApi.fronteggAuthApiRoutes.indexOf(path) !== -1 || path.endsWith('/postlogin') || path.endsWith('/prelogin')) {
37
34
  return "".concat(options.envAppUrl, "/api");
38
35
  }
39
36
  else {
@@ -1148,13 +1145,19 @@ function fronteggMiddleware(req, res) {
1148
1145
  buffer = Buffer.concat([buffer, chunk]);
1149
1146
  })
1150
1147
  .on('end', function () { return tslib.__awaiter(_this, void 0, void 0, function () {
1151
- var output, isLogout, _a, session, decodedJwt, sessionCookie;
1152
- var _b, _c;
1153
- return tslib.__generator(this, function (_d) {
1154
- switch (_d.label) {
1148
+ var output, logoutRoutes, isLogout, _a, session, decodedJwt, sessionCookie;
1149
+ return tslib.__generator(this, function (_b) {
1150
+ switch (_b.label) {
1155
1151
  case 0:
1156
1152
  output = buffer.toString('utf-8');
1157
- isLogout = (_b = req === null || req === void 0 ? void 0 : req.url) === null || _b === void 0 ? void 0 : _b.endsWith((_c = restApi.fronteggAuthApiRoutes.find(function (path) { return path.endsWith('/logout'); })) !== null && _c !== void 0 ? _c : '/logout');
1153
+ logoutRoutes = restApi.fronteggAuthApiRoutes.filter(function (path) { return path.endsWith('/logout'); });
1154
+ isLogout = false;
1155
+ logoutRoutes.forEach(function (route) {
1156
+ var _a;
1157
+ if ((_a = req === null || req === void 0 ? void 0 : req.url) === null || _a === void 0 ? void 0 : _a.endsWith(route)) {
1158
+ isLogout = true;
1159
+ }
1160
+ });
1158
1161
  if (!isLogout) return [3 /*break*/, 1];
1159
1162
  CookieManager$1.removeCookies({
1160
1163
  isSecured: isSecured,
@@ -1165,7 +1168,7 @@ function fronteggMiddleware(req, res) {
1165
1168
  return [3 /*break*/, 3];
1166
1169
  case 1: return [4 /*yield*/, createSessionFromAccessToken(output)];
1167
1170
  case 2:
1168
- _a = _d.sent(), session = _a[0], decodedJwt = _a[1];
1171
+ _a = _b.sent(), session = _a[0], decodedJwt = _a[1];
1169
1172
  if (session) {
1170
1173
  sessionCookie = CookieManager$1.createCookie({
1171
1174
  value: session,
@@ -1174,7 +1177,7 @@ function fronteggMiddleware(req, res) {
1174
1177
  });
1175
1178
  CookieManager$1.addToCookies(sessionCookie, serverResponse);
1176
1179
  }
1177
- _d.label = 3;
1180
+ _b.label = 3;
1178
1181
  case 3:
1179
1182
  res.setHeader('content-length', output.length);
1180
1183
  res.setHeader('content-encoding', '');
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/nextjs",
3
3
  "libName": "FronteggNextJs",
4
- "version": "6.7.10-alpha.3922844767",
4
+ "version": "6.7.10-alpha.3923067425",
5
5
  "author": "Frontegg LTD",
6
6
  "license": "MIT",
7
7
  "types": "dist/index.d.ts",
8
8
  "dependencies": {
9
- "@frontegg/js": "6.63.0",
10
- "@frontegg/react-hooks": "6.63.0",
9
+ "@frontegg/js": "6.64.0",
10
+ "@frontegg/react-hooks": "6.64.0",
11
11
  "@types/http-proxy": "^1.17.9",
12
12
  "cookie": "^0.5.0",
13
13
  "http-proxy": "^1.18.1",
package/server/index.js CHANGED
@@ -7,7 +7,7 @@ import { c as createGetSession } from '../createGetSession-bee8af0a.js';
7
7
  import 'jose';
8
8
  import '@frontegg/react-hooks';
9
9
  import '@frontegg/rest-api';
10
- import { F as FronteggClientProviderNext13 } from '../FronteggClientProviderNext13-d020161d.js';
10
+ import { F as FronteggClientProviderNext13 } from '../FronteggClientProviderNext13-512c37b1.js';
11
11
  import '@frontegg/js';
12
12
  import '@frontegg/redux-store';
13
13
  import 'next/navigation';
@@ -1 +0,0 @@
1
- {"version":3,"file":"FronteggClientProviderNext13-d020161d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}