@newskit-render/auth 0.21.0 → 0.22.2

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
@@ -3,6 +3,44 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.22.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/auth@0.22.1...@newskit-render/auth@0.22.2) (2021-12-14)
7
+
8
+ **Note:** Version bump only for package @newskit-render/auth
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.22.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/auth@0.22.0...@newskit-render/auth@0.22.1) (2021-11-26)
15
+
16
+ **Note:** Version bump only for package @newskit-render/auth
17
+
18
+
19
+
20
+
21
+
22
+ # [0.22.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/auth@0.21.1...@newskit-render/auth@0.22.0) (2021-11-22)
23
+
24
+
25
+ ### Features
26
+
27
+ * **PPDSR-0:** fix broken dependecy ([#521](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/521)) ([2690dd3](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/2690dd3bc6cf61a88740a0ff935adf461be02416))
28
+
29
+
30
+
31
+
32
+
33
+ ## [0.21.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/auth@0.21.0...@newskit-render/auth@0.21.1) (2021-11-15)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **PPDSR-541:** change packages to get published ([#506](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/506)) ([4de773b](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/4de773b8e22663a2822f64255f347c32384532c0))
39
+
40
+
41
+
42
+
43
+
6
44
  # [0.21.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/auth@0.20.0...@newskit-render/auth@0.21.0) (2021-11-10)
7
45
 
8
46
 
package/README.md CHANGED
@@ -149,5 +149,3 @@ For the full page example see [preview page](https://github.com/newscorp-ghfb/nc
149
149
  To see Preview pages uses the following pattern:
150
150
 
151
151
  `{site-domain}/preview/{article-id}/version/{version-id}`
152
-
153
- .
@@ -1,6 +1,11 @@
1
- import { h } from 'preact';
2
- import { render, unmountComponentAtNode } from 'react-dom';
3
- import CookieView from '../client/CookieView';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var preact_1 = require("preact");
7
+ var react_dom_1 = require("react-dom");
8
+ var CookieView_1 = __importDefault(require("../client/CookieView"));
4
9
  describe('CookieView', function () {
5
10
  var container;
6
11
  beforeEach(function () {
@@ -8,13 +13,13 @@ describe('CookieView', function () {
8
13
  document.body.appendChild(container);
9
14
  });
10
15
  afterEach(function () {
11
- unmountComponentAtNode(container);
16
+ (0, react_dom_1.unmountComponentAtNode)(container);
12
17
  container.remove();
13
18
  container = { textContent: '' };
14
19
  });
15
20
  test('Not visible, no cookie set', function () {
16
- render(h(CookieView, null,
17
- h("div", null, "Not visible")), container);
21
+ (0, react_dom_1.render)((0, preact_1.h)(CookieView_1.default, null,
22
+ (0, preact_1.h)("div", null, "Not visible")), container);
18
23
  expect(container.textContent).toBe('');
19
24
  });
20
25
  test('Not visible, cookie set set to false', function () {
@@ -22,8 +27,8 @@ describe('CookieView', function () {
22
27
  writable: true,
23
28
  value: 'nextAuthShowLogOut=false',
24
29
  });
25
- render(h(CookieView, null,
26
- h("div", null, "visible")), container);
30
+ (0, react_dom_1.render)((0, preact_1.h)(CookieView_1.default, null,
31
+ (0, preact_1.h)("div", null, "visible")), container);
27
32
  expect(container.textContent).toBe('');
28
33
  });
29
34
  test('Visible, cookie set set to true', function () {
@@ -31,8 +36,8 @@ describe('CookieView', function () {
31
36
  writable: true,
32
37
  value: 'nextAuthShowLogOut=true',
33
38
  });
34
- render(h(CookieView, null,
35
- h("div", null, "visible")), container);
39
+ (0, react_dom_1.render)((0, preact_1.h)(CookieView_1.default, null,
40
+ (0, preact_1.h)("div", null, "visible")), container);
36
41
  expect(container.textContent).toBe('visible');
37
42
  });
38
43
  });
@@ -1,10 +1,15 @@
1
- import cookie from 'cookie';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var cookie_1 = __importDefault(require("cookie"));
2
7
  var CookieView = function (_a) {
3
8
  var _b = _a.cookieName, cookieName = _b === void 0 ? 'nextAuthShowLogOut' : _b, children = _a.children;
4
9
  return typeof document !== 'undefined'
5
- ? cookie.parse(document.cookie)[cookieName] === 'true'
10
+ ? cookie_1.default.parse(document.cookie)[cookieName] === 'true'
6
11
  ? children
7
12
  : null
8
13
  : null;
9
14
  };
10
- export default CookieView;
15
+ exports.default = CookieView;
@@ -1,7 +1,9 @@
1
- import { useSession } from 'next-auth/client';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var client_1 = require("next-auth/client");
2
4
  var PageWithAuth = function (_a) {
3
5
  var children = _a.children, isLoading = _a.isLoading, onDenied = _a.onDenied;
4
- var _b = useSession(), session = _b[0], loading = _b[1];
6
+ var _b = (0, client_1.useSession)(), session = _b[0], loading = _b[1];
5
7
  if (typeof window !== 'undefined' && loading)
6
8
  return isLoading;
7
9
  if (!session) {
@@ -11,4 +13,4 @@ var PageWithAuth = function (_a) {
11
13
  return children;
12
14
  }
13
15
  };
14
- export default PageWithAuth;
16
+ exports.default = PageWithAuth;
@@ -1,10 +1,12 @@
1
- import { createElement } from 'react';
2
- import { Provider } from 'next-auth/client';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var react_1 = require("react");
4
+ var client_1 = require("next-auth/client");
3
5
  var SessionProvider = function (_a) {
4
6
  var pageProps = _a.pageProps, children = _a.children;
5
7
  if (pageProps && pageProps.session !== undefined) {
6
- return createElement(Provider, { session: pageProps.session }, children);
8
+ return (0, react_1.createElement)(client_1.Provider, { session: pageProps.session }, children);
7
9
  }
8
10
  return children;
9
11
  };
10
- export default SessionProvider;
12
+ exports.default = SessionProvider;
@@ -1,12 +1,17 @@
1
- import PageWithAuth from './PageWithAuth';
2
- import SessionProvider from './SessionProvider';
3
- import CookieView from './CookieView';
4
- import { signIn, signOut, getSession } from 'next-auth/client';
5
- export default {
6
- PageWithAuth: PageWithAuth,
7
- getSession: getSession,
8
- SessionProvider: SessionProvider,
9
- signIn: signIn,
10
- signOut: signOut,
11
- CookieView: CookieView,
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var PageWithAuth_1 = __importDefault(require("./PageWithAuth"));
7
+ var SessionProvider_1 = __importDefault(require("./SessionProvider"));
8
+ var CookieView_1 = __importDefault(require("./CookieView"));
9
+ var client_1 = require("next-auth/client");
10
+ exports.default = {
11
+ PageWithAuth: PageWithAuth_1.default,
12
+ getSession: client_1.getSession,
13
+ SessionProvider: SessionProvider_1.default,
14
+ signIn: client_1.signIn,
15
+ signOut: client_1.signOut,
16
+ CookieView: CookieView_1.default,
12
17
  };
@@ -1,16 +1,21 @@
1
- import NextAuth from 'next-auth';
2
- import Providers from 'next-auth/providers';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var next_auth_1 = __importDefault(require("next-auth"));
7
+ var providers_1 = __importDefault(require("next-auth/providers"));
3
8
  var createAuthRoute = function (req, res, providerOptions) {
4
9
  var OKTA_CLIENT_ID = providerOptions.OKTA_CLIENT_ID, OKTA_CLIENT_SECRET = providerOptions.OKTA_CLIENT_SECRET, OKTA_DOMAIN = providerOptions.OKTA_DOMAIN;
5
10
  var options = {
6
11
  providers: [
7
- Providers.Okta({
12
+ providers_1.default.Okta({
8
13
  clientId: OKTA_CLIENT_ID,
9
14
  clientSecret: OKTA_CLIENT_SECRET,
10
15
  domain: OKTA_DOMAIN,
11
16
  }),
12
17
  ],
13
18
  };
14
- return NextAuth(req, res, options);
19
+ return (0, next_auth_1.default)(req, res, options);
15
20
  };
16
- export default createAuthRoute;
21
+ exports.default = createAuthRoute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/auth",
3
- "version": "0.21.0",
3
+ "version": "0.22.2",
4
4
  "description": "Newskit Render",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",